Dispatch based on SID
See original GitHub issueIt would be really nice if NatsDispatcher
used the underlying sid
to dispatch instead of a HashMap based on the subscription name. This would allow you to subscribe to the same topic multiple times. Now, this might not make that much sense from the client’s point of view, but it does make sense from a “load balance” point of view.
As a sort of “hack” I have our servers subscribe to each topic n
times, with a several second delay between each round of subscriptions. This allows our servers to warm up slowly. It’s also useful for balancing traffic across larger/smaller vms. I’m currently upgrading from the pre-1.0 client, where I could pass a shared queue into the subscribe
method. I think the dispatcher is really neat way to abstract the problem, but I’m unable to use it, because it doesn’t use the underlying sid.
Would you be open to review a pull request that changes this? I’m guessing it would end up being a breaking change, which is probably undesirable.
Otherwise, would you be interested in extending the connection interface to support:
public Subscription subscribe(String subject, String queueName, MessageQueue messageQueue);
…so I can support similar behavior to the pre-1.0 client?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
I have been swamped but will try to grok this in the next week or so
On Tue, Dec 11, 2018, 1:25 PM Garrett T <notifications@github.com wrote:
released in 2.6.0