question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dispatch based on SID

See original GitHub issue

It 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:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
sasburycommented, Dec 11, 2018

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:

Any thoughts from maintainers? I would really appreciate it!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nats-io/java-nats/issues/197#issuecomment-446367563, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKH0fhEM-lcQtD6WYjvpimUHpg5GlkYks5u4CKsgaJpZM4ZHGP8 .

0reactions
sasburycommented, Jul 22, 2019

released in 2.6.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dispatch based on SID · Issue #197 · nats-io/nats.java - GitHub
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...
Read more >
SID Dispatch - IEEE Computer Society
Empowering the People who Drive Technology.
Read more >
Dispatch directory and search artifacts - Splunk Documentation
The dispatch directory stores artifacts on nodes where the searches are run. ... Clean up the dispatch directory based on the age of...
Read more >
Suggested routes do not conform to SID - Dispatch - Navigraph
I hope some solution can be devised to cross-reference aircraft type to SID to routing options. Thanks. SimBrief November 2, 2021, 1:02am #2....
Read more >
Automatic Usermapping (SID &UID) and Replicating Mapping ...
How to know if the SID and UID get automatically mapped within Unity and in replicating a NAS server and would the user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found