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

Failover possible? #23

Open
madkote opened this issue Feb 28, 2020 · 6 comments
Open

Failover possible? #23

madkote opened this issue Feb 28, 2020 · 6 comments

Comments

@madkote
Copy link

madkote commented Feb 28, 2020

hi,

is there failover functionality?

E.g.: https://github.com/jasonrbriggs/stomp.py/blob/010b245bc869381e25895b26d987ca19df1d2a2c/stomp/connect.py#L123

@pedrokiefer
Copy link
Owner

It supports automatic reconnecting, but there is no support for a list of servers. I think it's simple to extend the reconnect code add this functionality though.

@madkote
Copy link
Author

madkote commented Feb 28, 2020

thx for reply.

list of servers would be very useful.

@madkote
Copy link
Author

madkote commented Feb 28, 2020

it is a loop over tuples of hosts and ports, instead connecting to one host+port.

@pedrokiefer
Copy link
Owner

Maybe extracting the reconnect logic to another class, and make it composable, so one can have different heuristics for reconnection, like:

  • retry forever on one server (default)
  • try first server, failover to second server (failover strategy)
  • try first server, retry once, try second server, retry once (failover with retry strategy)
  • ...

Sounds good to you ?

@madkote
Copy link
Author

madkote commented Mar 5, 2020

Hi @pedrokiefer , thank for your reply.

  • retry forever on one server -> should be customizable -1, .., n == infinite to N
  • failover -> yes, it sounds good. There should be then two retry values - for retry on server and retry failover. Whereby, I personally, would do only one attempt to one of the servers and go to the next in case of failure -> interest here is to find a server asap.

Are you going to implement this soon? otherwise I can also leave with my customization.

@madkote
Copy link
Author

madkote commented Mar 6, 2020

when implementing failover be aware of following behaviour with ActiveMQ in cluster mode:

  • connections are only acceptable to the master
  • when connection to a slave, the connection is accepted, but slave disconnects it after some short period of time.

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