-
Notifications
You must be signed in to change notification settings - Fork 41.2k
HA/Failover support with Artemis #17623
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
Comments
I am not sure I understand what you're trying to do. Do I understand you want to use HA with an embedded broker?
What does that look like exactly? And what benefits such setup brings? I can see that the auto-configuration could benefit from reusing an existing |
I want to achieve 2 things:
So, to me, it seems that I can either use auto-configuration without HA, or manually configure with HA and then create a test connection factory for my integration test classes. Would I be able to utilize |
Thanks for the feedback. Can you share the code you have to enable failover? This will help figuring out how far we are to support this one way or the other. |
Here are my config classes:
Config to add failover:
Properties file:
Test Properties file:
|
So it looks like you've been able to set it up quite nicely in the end. We could add support for HA in Spring Boot itself but we haven't seen a lot of demand for it and your current code is quite concise. There is no test slice for JMS and therefore no easy way to "force"/replace the mode if it has been set by the user. If we consider adding one, this should be done in a separate issue. |
We discussed this one at the last meeting and decided we didn't want to extend our JMS support in that direction. The customizer does its job quite nicely anyway IMO. Thanks for the suggestion in any case. |
@snicoll IMO failover transport must be supported. The Failover Transport and Transport Options are pretty common options for real Production usage and expected to be supported according to https://activemq.apache.org/failover-transport-reference.html However, for simple ActiveMQ I think that For Artemis, isn't there this capability? I guess related also to Open Issue: #10739 |
@kmandalas, yes Artemis has this capability as well, although the syntax and functionality is a bit different. You'd simply specify |
@jbertram In the JavaDoc of
So this approach above, will it work with External Broker in Production environment? If an active Broker node becomes inactive and the passive takes over is this approach valid? |
@kmandalas unless I'm missing something I don't see how a callback for configuring an embedded broker will help with an external broker. The two use-cases are quite different. |
@jbertram please check code snippet in #17623 (comment)
Notice the @Profile("!test") usage: seems like a workaround to be able to add My question is: does Spring support Artemis Cluster (HA/Failover)? With or without auto-configuration? Otherwise it practically cannot be used in any production use case. |
@kmandalas you've already answered that question yourself and @jbertram gave you several hints already. If Artemis has the capability (it has), then there's nothing stopping you from configuring that for your Spring applications. Once #10739 is implemented, then you can specify the url using configuration only and let the auto-configuration drives things for you. If you have more questions, please follow-up on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. |
I am trying to use
spring-boot-starter-artemis
in my application so that I can utilize auto-configuration, as well as an embedded broker with testing, although I am unable to set up high availability/failover with auto-configuration for non-test code. The only method I have been successful with is creating my ownConnectionFactory
, which then prevents me from using an embedded broker viaapplication.properties
because it seems that auto-configuration is then disabled. Our application previously used ActiveMQ which allowed us to define the failover in the broker URL. Does anyone have any idea how to achieve this with Artemis?The text was updated successfully, but these errors were encountered: