Configure MDB to reconnect to remote HornetQ with specified interval
Issue
One of our EJB3 MDB listen to remote HornetQ and if HornetQ server is goes down, the MDB is configured to reconnect to the destination with specified interval.
Based on the configure we expect the MDB to reconnect 32 times with 15 minutes interval. However, it looks that is not happening. It just tries 32 times without delay.
Here is MDB ActivationConfigProperty annotations looks like
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "myQueue",
@ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "32"),
@ActivationConfigProperty(propertyName = "reconnectInterval", propertyValue = "900"),
@ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=myHost;port=5445")})
Here's the relevant log messages:
2013-04-23 14:57:00,939 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-23 (HornetQ-client-global-threads-5553121)) Failed to connect to server.
2013-04-23 14:57:00,977 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-18 (HornetQ-client-global-threads-5553121)) Tried 32 times to connect. Now giving up on reconnecting it.
2013-04-23 14:57:00,977 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-18 (HornetQ-client-global-threads-5553121)) Failed to connect to server.
2013-04-23 14:57:00,988 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-74 (HornetQ-client-global-threads-5553121)) Tried 32 times to connect. Now giving up on reconnecting it.
2013-04-23 14:57:00,988 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-74 (HornetQ-client-global-threads-5553121)) Failed to connect to server.
2013-04-23 14:57:00,989 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-14 (HornetQ-client-global-threads-5553121)) Tried 32 times to connect. Now giving up on reconnecting it.
2013-04-23 14:57:00,989 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-14 (HornetQ-client-global-threads-5553121)) Failed to connect to server.
2013-04-23 14:57:00,989 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-19 (HornetQ-client-global-threads-5553121)) Tried 32 times to connect. Now giving up on reconnecting it.
2013-04-23 14:57:00,989 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-19 (HornetQ-client-global-threads-5553121)) Failed to connect to server.
2013-04-23 14:57:00,998 WARN [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-10 (HornetQ-client-global-threads-5553121)) Tried 32 times to connect. Now giving up on reconnecting it.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.1.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
