Greetings,

I’d like to ensure maximal resilience of the broker connection, specifically:

  *   If the Artemis broker is not running when our services start, the 
connection attempt hangs until the broker is available, and then returns the 
connection
  *   If the Artemis broker fails while our services are running, our services 
consumers and producers will hang/block until the broker is available

I *thought* I was doing that by using the URL
tcp://localhost:61616?reconnectAttempts=-1

However, I find that the connection attempt just throws an exception

java.lang.RuntimeException: Failed to create JMS connection to 
'tcp://localhost:61616?reconnectAttempts=-1'
        at 
net.redpoint.ipc.jms.JmsStaticConnectionPool.makeConnection(JmsStaticConnectionPool.java:83)
        at 
net.redpoint.ipc.jms.JmsStaticConnectionPool.lambda$getConnection$0(JmsStaticConnectionPool.java:46)
        at 
java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
        at 
net.redpoint.ipc.jms.JmsStaticConnectionPool.getConnection(JmsStaticConnectionPool.java:46)
        at 
net.redpoint.ipc.jms.JmsServerBase.getConnection(JmsServerBase.java:77)
        at net.redpoint.ipc.jms.JmsServerBase.start(JmsServerBase.java:63)
        at 
net.redpoint.ipc.servers.TopicServerBase.start(TopicServerBase.java:36)
        at 
net.redpoint.rpdm.cache_invalidation_query.CacheInvalidationQueryServerImpl.start(CacheInvalidationQueryServerImpl.java:100)
        at 
net.redpoint.rpdm.combinedservice.CombinedServices.start(CombinedServices.java:75)
        at 
net.redpoint.rpdm.combinedservice.CombinedServices.run(CombinedServices.java:114)
        at net.redpoint.rpdm.combinedservice.Main.main(Main.java:51)
Caused by: javax.jms.JMSException: Failed to create session factory
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:867)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:284)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:279)
        at 
net.redpoint.ipc.jms.MyConnectionFactory.createConnection(MyConnectionFactory.java:31)
        at 
net.redpoint.ipc.jms.JmsStaticConnectionPool.makeConnection(JmsStaticConnectionPool.java:76)
        ... 10 more
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED 
message=AMQ219007: Cannot connect to server(s). Tried with all available 
servers.]
        at 
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:703)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:865)
        ... 14 more

Can someone help me understand how this is designed to work, and how best to 
achieve the two goals above?

Thanks
John



[rg] <https://www.redpointglobal.com/>

John Lilley

Data Management Chief Architect, Redpoint Global Inc.

888 Worcester Street, Suite 200 Wellesley, MA 02482

M: +1 7209385761<tel:+1%207209385761> | 
john.lil...@redpointglobal.com<mailto:john.lil...@redpointglobal.com>

PLEASE NOTE: This e-mail from Redpoint Global Inc. (“Redpoint”) is confidential 
and is intended solely for the use of the individual(s) to whom it is 
addressed. If you believe you received this e-mail in error, please notify the 
sender immediately, delete the e-mail from your computer and do not copy, print 
or disclose it to anyone else. If you properly received this e-mail as a 
customer, partner or vendor of Redpoint, you should maintain its contents in 
confidence subject to the terms and conditions of your agreement(s) with 
Redpoint.

Reply via email to