You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the startup of our application, a lot of data needs to be loaded and retained, so that when a customer/client connects, it will see the state of the certain things that it has access too. This can vary from time to time, but the total amount of messages is about 50k, but in the future this can easily increase to 500k.
Currently we just loop over all the data and publish all the messages one for one, via the PublishService#publish with a PublishMessage which has the flag retain set. This all works fine, but takes a long time, taking a long time before our pod is open for connection.
I tried moving to the retainedMessageStore#addOrReplace on startup (while clients are connected you cannot use this of course), expecting this to be a lot faster. Too my surprise this turned out to be slower (roughly 2x as slow) then just doing PublishService#publish, which I find weird as the retainedMessageStore#addOrReplace has to do less.
Preferred solution or suggestions
A method which would be greatly appreciated (if optimized), would be something like retainedMessageStore#addAll, which would take Collection of type RetainedPublish. Or maybe a method like retainedMessageStore#initialize, which you can only use once. I assume with the prior knowledge you should be able to greatly optimize the storing of this data. Making startups in cases like this a lot faster.
I understand that this is a lot to ask, and feel free to shut it down. Its just an idea I wanted to share :)!
The text was updated successfully, but these errors were encountered:
Problem or use case
On the startup of our application, a lot of data needs to be loaded and retained, so that when a customer/client connects, it will see the state of the certain things that it has access too. This can vary from time to time, but the total amount of messages is about 50k, but in the future this can easily increase to 500k.
Currently we just loop over all the data and publish all the messages one for one, via the
PublishService#publish
with a PublishMessage which has the flag retain set. This all works fine, but takes a long time, taking a long time before our pod is open for connection.I tried moving to the
retainedMessageStore#addOrReplace
on startup (while clients are connected you cannot use this of course), expecting this to be a lot faster. Too my surprise this turned out to be slower (roughly 2x as slow) then just doingPublishService#publish
, which I find weird as theretainedMessageStore#addOrReplace
has to do less.Preferred solution or suggestions
A method which would be greatly appreciated (if optimized), would be something like
retainedMessageStore#addAll
, which would take Collection of typeRetainedPublish
. Or maybe a method likeretainedMessageStore#initialize
, which you can only use once. I assume with the prior knowledge you should be able to greatly optimize the storing of this data. Making startups in cases like this a lot faster.I understand that this is a lot to ask, and feel free to shut it down. Its just an idea I wanted to share :)!
The text was updated successfully, but these errors were encountered: