I'm glad you got your issue sorted. Feel free to send your SequentialConnectionLoadBalancingPolicy implementation as a PR to be included in future releases. That sounds like a worthwhile addition.
Justin On Fri, Feb 21, 2025 at 9:16 AM Schmidt, Mihael <mschm...@bauformat.de> wrote: > Hi all, > > after some further research I found the problem. I didn't specify the > parameter "failoverAttempts" on the connection url. After adding it > everything worked fine. > > Have a great day! > > Mihael > > PS: ... and the error is also described in the docs. 😉 > > > > > > > *Mihael SchmidtSoftware Engineering Bauformat Küchen GmbH & Co. KG* > Kattwinkel 1 | 32584 Löhne | Deutschland > > Fon: +495732 102-379 > Fax: +495732 102-300 > Mail: mschm...@bauformat.de > Internet: www.bauformat.de > > > > Umsatzsteuer-Identifikationsnummer: *DE 124323068 *- Steuer-Nr.: > 310/5705/0461 / Finanzamt Bünde - Handelsregister Bad Oeynhausen HRA 1801 > Komplementärin: Bauformat Küchen Verwaltungs GmbH - Handelsregister Bad > Oeynhausen HRB 1465 > Geschäftsführer: Michael Assner, Matthias Berens, Sabine Brockschnieder > > <https://www.bauformat.de> > > Wir erfüllen unsere Informationspflichten zum Datenschutz gem. Artt. 13-14 > DS-GVO durch Veröffentlichung auf unserer Internetseite unter: > www.bauformat.de/datenschutz oder durch Zusendung auf Ihre formlose > Anfrage. > ------------------------------ > *Von:* Schmidt, Mihael > *Gesendet:* Freitag, 21. Februar 2025 10:27 > *An:* users@activemq.apache.org <users@activemq.apache.org> > *Betreff:* Artemis Client Connection String for Dual Mirror > > Hi, > > I got an Artemis dual mirror setup and basically it works fine. Now I want > to test the failover on the client side. I use the following > > artemis-jms-client 2.39.0 > factory: org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory > connection string: (*tcp*://host:41091,*tcp* > ://host:41101)?ha=true&reconnectAttempts=3&useTopologyForLoadBalancing=false&connectionLoadBalancingPolicyClassName=testingground.mq.SequentialConnectionLoadBalancingPolicy > Helidon 4.1.6 > > I use my own ConnectionLoadBalancingPolicy implementation which starts > with the first host/connection and then goes to the next one (like the > RoundRobin implementation but just always starting with the first one). > > Everything works fine till I stop the one server instance the client is > connected to. I expected that it just creates a new connection and uses the > second server instance but it just fails with this: > > 2025.02.21 10:05:37 INFO org.apache.activemq.artemis.core.client > Thread[#91,Thread-0 (ActiveMQ-client-global-threads),5,main]: AMQ214036: > Connection closure to host/xxx.xxx.xxx.xxx:41091 has been detected: > AMQ219015: The connection was disconnected because of server shutdown > [code=DISCONNECTED] > 2025.02.21 10:05:48 WARNING org.apache.activemq.artemis.core.client > Thread[#91,Thread-0 (ActiveMQ-client-global-threads),5,main]: AMQ212005: > Tried 3 times to connect. Now giving up on reconnecting it. > 2025.02.21 10:05:48 SEVERE > io.helidon.messaging.connectors.jms.JmsConnector > Thread[#62,jms-3,5,jms-thread-pool-1]: Error intercepted from channel events > *java.util.concurrent.CompletionException*: > *io.helidon.messaging.MessagingException*: Error during sending JMS > message. > at java.base/java.util.concurrent.CompletableFuture.encodeThrowable( > *CompletableFuture.java:315*) > at java.base/java.util.concurrent.CompletableFuture.completeThrowable( > *CompletableFuture.java:320*) > at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run( > *CompletableFuture.java:1770*) > at io.helidon.common.context.ContextAwareExecutorImpl.lambda$wrap$8( > *ContextAwareExecutorImpl.java:161*) > at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( > *ThreadPoolExecutor.java:1144*) > at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run( > *ThreadPoolExecutor.java:642*) > at java.base/java.lang.Thread.run(*Thread.java:1583*) > Caused by: *io.helidon.messaging.MessagingException*: Error during > sending JMS message. > at > io.helidon.messaging.connectors.jms.JmsConnector.lambda$sendingErrorHandler$18( > *JmsConnector.java:674*) > at io.helidon.messaging.connectors.jms.JmsConnector.consumeAsync( > *JmsConnector.java:660*) > at io.helidon.messaging.connectors.jms.JmsConnector.lambda$consume$16( > *JmsConnector.java:637*) > at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run( > *CompletableFuture.java:1768*) > ... 4 more > Caused by: *jakarta.jms.JMSException*: AMQ219016: Connection failure > detected. Unblocking a blocking call that will never get a response > at io.helidon.messaging.connectors.jms.shim.ShimUtil.exception( > *ShimUtil.java:67*) > at io.helidon.messaging.connectors.jms.shim.ShimUtil.run( > *ShimUtil.java:42*) > at io.helidon.messaging.connectors.jms.shim.JakartaMessageProducer.send( > *JakartaMessageProducer.java:106*) > at io.helidon.messaging.connectors.jms.JmsConnector.consumeAsync( > *JmsConnector.java:657*) > ... 6 more > Suppressed: *javax.jms.JMSException*: AMQ219016: Connection failure > detected. Unblocking a blocking call that will never get a response > at > org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking( > *ChannelImpl.java:580*) > at > org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking( > *ChannelImpl.java:465*) > at > org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking( > *ChannelImpl.java:457*) > at > org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.sendFullMessage( > *ActiveMQSessionContext.java:589*) > at > org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.sendRegularMessage( > *ClientProducerImpl.java:305*) > at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.doSend( > *ClientProducerImpl.java:277*) > at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.send( > *ClientProducerImpl.java:147*) > at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.send( > *ClientProducerImpl.java:129*) > at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.doSendx( > *ActiveMQMessageProducer.java:483*) > at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.send( > *ActiveMQMessageProducer.java:194*) > at > io.helidon.messaging.connectors.jms.shim.JakartaMessageProducer.lambda$send$6( > *JakartaMessageProducer.java:106*) > at io.helidon.messaging.connectors.jms.shim.ShimUtil.run( > *ShimUtil.java:40*) > ... 8 more > Caused by: ActiveMQUnBlockedException[errorType=UNBLOCKED > message=AMQ219016: Connection failure detected. Unblocking a blocking call > that will never get a response] > ... 20 more > > Am I doing something wrong? Does an automatic failover to the next server > even work with the dual mirror setup? > > Thanks in advance for any help and advice. > > Mihael > >