stomp-rs
stomp-rs copied to clipboard
Reconnecting changes state of session
In my app I connect to a queue with 5 threads with Heartbeat enabled on the connection and prefetch_count
enabled on the subscription which is equal to 1. All works great.
However, there are connections that have very little connectivity causing the session to disconnect. Now it is great that reconnect
is build-in, but there seems to be a problem after reconnecting. Suddenly my worker queue turns into a publish/subscribe queue. All 5 threads receive the same message when it is published on the queue, where as before reconnecting only one thread/worker received the message.
@zslayton My guess is that some of the headers are not added again after reconnecting. Do you have a clue where to look for? Because I would love to help with solving issue. Maybe you can point me into a direction where things might go wrong. Of course, I will also start investigating myself too.
In the source I find two possible causes.
- There is a problem with cloning the session builder
- The subscription frames are not copied into the new subscription.
Since there is very little connectivity I changed the number of threads to one. Which is a nice workaround on a server with little activity, but that could be trouble some for high traffic servers.