There is a service with spring-boot-starter-activemq in dependencies. Producing JMS messages with JmsTemplate can cause problems with an Artemis cluster if the service connected to the cluster using ActiveMQ failover transport.
Message redistribution fails on one of the cluster nodes at some point, and then messages start to stick in a service queue with name like $.artemis.internal.sf.CLUSTER_NAME.NODE_NAME. The failed node can only receive messages from other cluster nodes after that but not send. Stuck messages can be delivered only after node's restart.
Typical stack trace on the failed node looks like:
This problem doesn't occur with Spring Boot 1.5.18+, 2.0.7+ and 2.1.0+ if default properties are used. But it occurs if older versions of dependencies are used or JMS caching is disabled or plain ActiveMQConnectionFactory used instead of CachingConnectionFactory or PooledConnectionFactory.
Example project and configuration of cluster with 2 nodes are attached.
It seems like the issue is more related to Artemis, and it is solved in newer versions of Spring Boot by JMS caching. But developers may not be aware about such problems, so it would be quite good to have a note in docs about it.
Alexander Kosarev opened SPR-17554 and commented
There is a service with spring-boot-starter-activemq in dependencies. Producing JMS messages with JmsTemplate can cause problems with an Artemis cluster if the service connected to the cluster using ActiveMQ failover transport.
Message redistribution fails on one of the cluster nodes at some point, and then messages start to stick in a service queue with name like $.artemis.internal.sf.CLUSTER_NAME.NODE_NAME. The failed node can only receive messages from other cluster nodes after that but not send. Stuck messages can be delivered only after node's restart.
Typical stack trace on the failed node looks like:
This problem doesn't occur with Spring Boot 1.5.18+, 2.0.7+ and 2.1.0+ if default properties are used. But it occurs if older versions of dependencies are used or JMS caching is disabled or plain ActiveMQConnectionFactory used instead of CachingConnectionFactory or PooledConnectionFactory.
Example project and configuration of cluster with 2 nodes are attached.
Tested on Artemis 2.6.3 and relative JBoss AMQ 7
Affects: 4.3.21, 5.1.3
Attachments:
The text was updated successfully, but these errors were encountered: