Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue related to AMQ Active-Passive #84

Open
Baji07 opened this issue Jul 31, 2018 · 2 comments
Open

Issue related to AMQ Active-Passive #84

Baji07 opened this issue Jul 31, 2018 · 2 comments

Comments

@Baji07
Copy link

Baji07 commented Jul 31, 2018

Does stompit.ConnectFailover handle AMQ Active-Passive configurations. In our case, only the primary accepts client connection and the Passive one rejects, so heartbeat and connection always fails on the Passive. Is there a way to stay on the Active via stompit and only switch when passive becomes active.

@gdaws
Copy link
Owner

gdaws commented Aug 3, 2018

I haven't used Stompit with an AMQ Active-Passive configuration so I can't confirm how it's actually handled.

I guess the randomize: false setting is what you need. With this setting, the connect and reconnects to hosts in the specified server list in a round-robin fashion.

So the expected behaviour of stompit.ConnectFailover with configuration (['primary-host', 'secondary-host'], {randomize: false}) when for example the active host becomes unavailable and then later the passive host becomes unavailable, would look like this:

  1. [Action] Connect to primary-host
  2. [Event] primary-host goes offline
  3. [Action] Connect to secondary-host
  4. [Event] secondary-host goes offline
  5. Goto step 1

@Baji07
Copy link
Author

Baji07 commented Aug 3, 2018

Thanks for your response. I tried the randomize:false setting, but it didn't seem to help either. So there are actually two issues. First, issue is missing some messages, when i use the http://gdaws.github.io/node-stomp/api/connect-failover/ in a Active-Passive scenario. What i noticed is we are trying to connect to both hosts and during this time, if a message comes in, we are missing them.

So that being said, i removed the passive host and some messages are still missed, when Heartbeat is higher number, ex (1 second )and alwaysConnected flag is set to true. Our case is such that messages come in sometimes frequently other times there maybe a pause in messages. What's the preferred heartbeat value so that the connection is available and always connected ?. Any help on how to use the API and parameters, and any insight on how to stay connected even when there is no activity would be useful as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants