Some subscriptions are lost when reconnecting #943
Replies: 2 comments 4 replies
-
Looping in @scottf |
Beta Was this translation helpful? Give feedback.
-
@Gutaicheng So I have a few questions, but let's consider your use case first. You have 300,000 re-subscriptions trying to happen, the server simply cannot do that amount of work in the short time given. I think the making the timeout longer is exactly why it's available, for you to tune your specific case to actual behavior. How big is your cluster? The more servers that this work is split between will make a difference. |
Beta Was this translation helpful? Give feedback.
-
After I read the source code of jnatsdk, I found that the method of sending subscription information is different when connecting for the first time and reconnecting (I use Dispatcher to subscribe).
The first connection will execute
queueOutgoing
, and the reconnection will executequeueInternalOutgoing
;There is no limit to the MessageQueue when reconnecting. When all clients reconnect and resubscribe, the subscription will be lost.
I have observed this under the following conditions:
I found that the connectionTimeout time set by the client will affect the result of resubscribing. If I change the default 2s to 5s, then 300,000 topics will be fully subscribed when reconnecting.
I think it is unwise to modify the connectionTimeout to ensure that the subscription is not lost when reconnecting. Is there any other solution to ensure that the subscription is not lost when reconnecting?
Beta Was this translation helpful? Give feedback.
All reactions