Mule
  1. Mule
  2. MULE-3981

Custom retry-template doesn't appear to be reconnecting with a lost JMS server

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.1
    • Component/s: Transport: JMS
    • Labels:
      None
    • Environment:

      OS/X

    • User impact:
      Medium
    • Configuration:
      Hide

      <jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="$

      {jms.url}

      ">

      Show
      <jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="$ {jms.url} ">
    • Log Output:
      Hide
      ERROR 2008-11-22 11:33:13,097 [jmsConnector.dispatcher.1] org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy: The JMS connection has failed: java.io.EOFException
      org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException
      at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1260)
      at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:294)
      at org.mule.transport.jms.Jms11Support.createSession(Jms11Support.java:63)
      at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:415)
      at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:387)
      at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:128)
      at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:65)
      at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:273)
      at org.mule.work.WorkerContext.run(WorkerContext.java:310)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
      at java.lang.Thread.run(Thread.java:613)
      Caused by: java.io.EOFException
      at java.io.DataInputStream.readInt(DataInputStream.java:358)
      at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
      at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:203)
      at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:195)
      at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
      ... 1 more
      Show
      ERROR 2008-11-22 11:33:13,097 [jmsConnector.dispatcher.1] org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy: The JMS connection has failed: java.io.EOFException org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1260) at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:294) at org.mule.transport.jms.Jms11Support.createSession(Jms11Support.java:63) at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:415) at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:387) at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:128) at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:65) at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:273) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:613) Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:358) at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269) at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:203) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:195) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183) ... 1 more
    • Similar Issues:
      MULE-952Why doesn't my JMS queue consumer reconnect?
      MULE-5564Periodic errors after JMS reconnect
      MULE-2616MuleWorkManager is stopped after JMS reconnection
      MULE-4600JMS-Connector doesn't reconnet to queue
      MULE-5653Weblogic JMS transport, error in the reconnection to JMS
      MULE-5167JMS retry (reconnection)
      MULE-780Introduce an option to disable JMS connection recovery
      MULE-718inbound queues are not polled after successful reconnect
      MULE-5124ActiveMQ connectors fail to reconnect after JMS server restart
      MULE-7534JMS connector doesn't reconnect to ActiveMQ broker 5.6 when using blocking=true

      Description

      I have the following AbstractPolicyTemplate and RetryPolicy implementations:

      public class SimpleRetryPolicyTemplate extends AbstractPolicyTemplate {

      public RetryPolicy createRetryInstance()

      { return new SimpleRetryPolicy(); }

      protected static class SimpleRetryPolicy implements RetryPolicy {
      public PolicyStatus applyPolicy(Throwable throwable) {
      try

      { Thread.sleep(5000); }

      catch (InterruptedException e)

      { throw new RuntimeException(e); }

      return PolicyStatus.policyOk();
      }
      }
      }

      When configured on an ActiveMQ connector as follows:

      <jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="$

      {jms.url}

      ">

      The retry policy works on Mule startup - if the ActiveMQ server is down, the connector will attempt to reconnect every 5 seconds. If I bring the ActiveMQ server down, however, the exception entered in "Log Output" is thrown. The "Configuring Retry Policies" documentation (http://mule.mulesource.org/display/MULE2USER/Configuring+Retry+Policies) seems to indicate this should work. I haven't (yet) tested with other transport.s

        Activity

        Hide
        john demic added a comment -

        Sorry, I failed to add the full configuration. Here it is:

        <jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="$

        {jms.url}

        ">
        <spring:property name="retryPolicyTemplate">
        <spring:bean class="SimpleRetryPolicyTemplate"/>
        </spring:property>
        </jms:activemq-connector>

        Show
        john demic added a comment - Sorry, I failed to add the full configuration. Here it is: <jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="$ {jms.url} "> <spring:property name="retryPolicyTemplate"> <spring:bean class="SimpleRetryPolicyTemplate"/> </spring:property> </jms:activemq-connector>
        Hide
        john demic added a comment -

        You can close this JIRA, it was user error on my part. I had MULE_HOME set to a 2.1.0 installation and not 2.1.1 inadvertently. Reconnection appears to working fine in 2.1.1 with ActiveMQ.

        Show
        john demic added a comment - You can close this JIRA, it was user error on my part. I had MULE_HOME set to a 2.1.0 installation and not 2.1.1 inadvertently. Reconnection appears to working fine in 2.1.1 with ActiveMQ.
        Hide
        Ken Yagen added a comment -

        Travis - can you review if this issue can be closed? The reporter indicates so.

        Show
        Ken Yagen added a comment - Travis - can you review if this issue can be closed? The reporter indicates so.

          People

          • Assignee:
            Travis Carlson
            Reporter:
            john demic
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development