Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-1133

Application using Spring JMSTemplate continues to use a stale connection to broker after a network outage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • AMQ 7.1.0.GA
    • core-protocol
    • None

      An application uses a long-lived Spring JMSTemplate instance to send messages to AMQ 7.1. After a network outage of significant duration (minutes) the application is seen to continue to use the stale TCP connection to the broker.

      Caused by: javax.jms.JMSException: AMQ119014: Timed out after waiting 30,000 ms for response when sending packet 71
      	at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:401) ~[artemis-core-client-2.0.0.amq-700011-redhat-1.jar:2.0.0.amq-700011-redhat-1]
      	...
      	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466) ~[spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      

      Under the Spring JMSTemplate is a Spring CachingConnectionFactory (which extends SingleConnectionFactory) which wraps the ActiveMQConnectionFactory. We can see that the Spring SCF code calls setExceptionHandler() on the broker connection – see line 421:

      https://github.com/spring-projects/spring-framework/blob/master/spring-jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory.java
      

      However, the Artemis client runtime never seems to call the registered exception listener, and the Spring infrastructure does not respond to connection failure. Thus the client continues to use a stale connection.

              mtaylor1@redhat.com Martyn Taylor (Inactive)
              rhn-support-kboone Kevin Boone
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: