You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Joe White <Jo...@recondotech.com> on 2009/02/27 00:59:54 UTC

ExchangePattern.InOut ActiveMq exception

In Camel 1.5 when using the ExchangePattern.InOut I get an exception
when tearing down the activemq broker the exception occurs no matter how
the thread is stopped. Is there configuration to allow the InOut pattern
to work without causing exceptions when the broker is shut-down? The
exception received at shutdown is below along with the spring config for
the my current activemq setup.

 

Thanks

Joe

 

16:47:00,284 INFO  [AdvisoryConsumer] (ActiveMQ Connection Worker:
tcp://localhost/127.0.0.1:61616) Failed to send remove command:
javax.jms.JMSException: Channel was inactive for too long:
localhost/127.0.0.1:61616

javax.jms.JMSException: Channel was inactive for too long:
localhost/127.0.0.1:61616

      at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:62)

... 

org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSh
aredConnection(AbstractJmsListeningContainer.java:385)

      at
org.springframework.jms.listener.SimpleMessageListenerContainer.onExcept
ion(SimpleMessageListenerContainer.java:206)

      at
org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:177
9)

      ...

Caused by: org.apache.activemq.transport.InactivityIOException: Channel
was inactive for too long: localhost/127.0.0.1:61616

      at
org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor
.java:225)

      at
org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.jav
a:83)

      at
org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego
tiator.java:100)

      at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:
40)

      at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelat
or.java:60)

      at
org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnect
ion.java:1214)

      ... 10 more

 

 

 

      <bean id="activemq"
class="org.apache.camel.component.jms.JmsComponent">

            <property name="connectionFactory">

                  <bean
class="org.apache.activemq.spring.ActiveMQConnectionFactory">

                        <property name="brokerURL"
value="tcp://localhost:61616?wireFormat.maxInactivityDuration=0" />

                        <property name="closeTimeout" value="0"/>

                  </bean>

            </property>

      </bean>

      

      <broker:broker useJmx="false" persistent="false"
brokerName="localhost">

        <broker:transportConnectors>

            <broker:transportConnector name="tcp"
uri="tcp://localhost:61616"/>

        </broker:transportConnectors>

    </broker:broker>


Re: ExchangePattern.InOut ActiveMq exception

Posted by Claus Ibsen <cl...@gmail.com>.
Hi Joe

I had a look at it.

The problem really comes down to the fact that Spring is handling the
stop order of AMQ and Camel.
So when AMQ is stopped first then Camel gets this exception when it
tries to stop its JMS queue listener.

So what is needed is to control the stop order and that is eg. spring stuff.



On Mon, Mar 2, 2009 at 5:03 PM, Joe White <Jo...@recondotech.com> wrote:
> Claus,
> The attached zip contains a test case the reproduces the exception at teardown. The test to run is called RouteTest in src/test/java/test. There are no assertions as the exception only happens at teardown and after looking more closely the exception is never thrown, just printed at INFO.
>
> Joe
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Saturday, February 28, 2009 3:17 AM
> To: users@camel.apache.org
> Subject: Re: ExchangePattern.InOut ActiveMq exception
>
> Hi
>
> Could you create a small sample application that demonstrates this?
> Will help while investigating.
>
>
> On Fri, Feb 27, 2009 at 12:59 AM, Joe White <Jo...@recondotech.com> wrote:
>> In Camel 1.5 when using the ExchangePattern.InOut I get an exception
>> when tearing down the activemq broker the exception occurs no matter how
>> the thread is stopped. Is there configuration to allow the InOut pattern
>> to work without causing exceptions when the broker is shut-down? The
>> exception received at shutdown is below along with the spring config for
>> the my current activemq setup.
>>
>>
>>
>> Thanks
>>
>> Joe
>>
>>
>>
>> 16:47:00,284 INFO  [AdvisoryConsumer] (ActiveMQ Connection Worker:
>> tcp://localhost/127.0.0.1:61616) Failed to send remove command:
>> javax.jms.JMSException: Channel was inactive for too long:
>> localhost/127.0.0.1:61616
>>
>> javax.jms.JMSException: Channel was inactive for too long:
>> localhost/127.0.0.1:61616
>>
>>      at
>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
>> java:62)
>>
>> ...
>>
>> org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSh
>> aredConnection(AbstractJmsListeningContainer.java:385)
>>
>>      at
>> org.springframework.jms.listener.SimpleMessageListenerContainer.onExcept
>> ion(SimpleMessageListenerContainer.java:206)
>>
>>      at
>> org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:177
>> 9)
>>
>>      ...
>>
>> Caused by: org.apache.activemq.transport.InactivityIOException: Channel
>> was inactive for too long: localhost/127.0.0.1:61616
>>
>>      at
>> org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor
>> .java:225)
>>
>>      at
>> org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.jav
>> a:83)
>>
>>      at
>> org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego
>> tiator.java:100)
>>
>>      at
>> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:
>> 40)
>>
>>      at
>> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelat
>> or.java:60)
>>
>>      at
>> org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnect
>> ion.java:1214)
>>
>>      ... 10 more
>>
>>
>>
>>
>>
>>
>>
>>      <bean id="activemq"
>> class="org.apache.camel.component.jms.JmsComponent">
>>
>>            <property name="connectionFactory">
>>
>>                  <bean
>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>
>>                        <property name="brokerURL"
>> value="tcp://localhost:61616?wireFormat.maxInactivityDuration=0" />
>>
>>                        <property name="closeTimeout" value="0"/>
>>
>>                  </bean>
>>
>>            </property>
>>
>>      </bean>
>>
>>
>>
>>      <broker:broker useJmx="false" persistent="false"
>> brokerName="localhost">
>>
>>        <broker:transportConnectors>
>>
>>            <broker:transportConnector name="tcp"
>> uri="tcp://localhost:61616"/>
>>
>>        </broker:transportConnectors>
>>
>>    </broker:broker>
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

RE: ExchangePattern.InOut ActiveMq exception

Posted by Joe White <Jo...@recondotech.com>.
Claus,
The attached zip contains a test case the reproduces the exception at teardown. The test to run is called RouteTest in src/test/java/test. There are no assertions as the exception only happens at teardown and after looking more closely the exception is never thrown, just printed at INFO.

Joe

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: Saturday, February 28, 2009 3:17 AM
To: users@camel.apache.org
Subject: Re: ExchangePattern.InOut ActiveMq exception

Hi

Could you create a small sample application that demonstrates this?
Will help while investigating.


On Fri, Feb 27, 2009 at 12:59 AM, Joe White <Jo...@recondotech.com> wrote:
> In Camel 1.5 when using the ExchangePattern.InOut I get an exception
> when tearing down the activemq broker the exception occurs no matter how
> the thread is stopped. Is there configuration to allow the InOut pattern
> to work without causing exceptions when the broker is shut-down? The
> exception received at shutdown is below along with the spring config for
> the my current activemq setup.
>
>
>
> Thanks
>
> Joe
>
>
>
> 16:47:00,284 INFO  [AdvisoryConsumer] (ActiveMQ Connection Worker:
> tcp://localhost/127.0.0.1:61616) Failed to send remove command:
> javax.jms.JMSException: Channel was inactive for too long:
> localhost/127.0.0.1:61616
>
> javax.jms.JMSException: Channel was inactive for too long:
> localhost/127.0.0.1:61616
>
>      at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
> java:62)
>
> ...
>
> org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSh
> aredConnection(AbstractJmsListeningContainer.java:385)
>
>      at
> org.springframework.jms.listener.SimpleMessageListenerContainer.onExcept
> ion(SimpleMessageListenerContainer.java:206)
>
>      at
> org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:177
> 9)
>
>      ...
>
> Caused by: org.apache.activemq.transport.InactivityIOException: Channel
> was inactive for too long: localhost/127.0.0.1:61616
>
>      at
> org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor
> .java:225)
>
>      at
> org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.jav
> a:83)
>
>      at
> org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego
> tiator.java:100)
>
>      at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:
> 40)
>
>      at
> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelat
> or.java:60)
>
>      at
> org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnect
> ion.java:1214)
>
>      ... 10 more
>
>
>
>
>
>
>
>      <bean id="activemq"
> class="org.apache.camel.component.jms.JmsComponent">
>
>            <property name="connectionFactory">
>
>                  <bean
> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>
>                        <property name="brokerURL"
> value="tcp://localhost:61616?wireFormat.maxInactivityDuration=0" />
>
>                        <property name="closeTimeout" value="0"/>
>
>                  </bean>
>
>            </property>
>
>      </bean>
>
>
>
>      <broker:broker useJmx="false" persistent="false"
> brokerName="localhost">
>
>        <broker:transportConnectors>
>
>            <broker:transportConnector name="tcp"
> uri="tcp://localhost:61616"/>
>
>        </broker:transportConnectors>
>
>    </broker:broker>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: ExchangePattern.InOut ActiveMq exception

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Could you create a small sample application that demonstrates this?
Will help while investigating.


On Fri, Feb 27, 2009 at 12:59 AM, Joe White <Jo...@recondotech.com> wrote:
> In Camel 1.5 when using the ExchangePattern.InOut I get an exception
> when tearing down the activemq broker the exception occurs no matter how
> the thread is stopped. Is there configuration to allow the InOut pattern
> to work without causing exceptions when the broker is shut-down? The
> exception received at shutdown is below along with the spring config for
> the my current activemq setup.
>
>
>
> Thanks
>
> Joe
>
>
>
> 16:47:00,284 INFO  [AdvisoryConsumer] (ActiveMQ Connection Worker:
> tcp://localhost/127.0.0.1:61616) Failed to send remove command:
> javax.jms.JMSException: Channel was inactive for too long:
> localhost/127.0.0.1:61616
>
> javax.jms.JMSException: Channel was inactive for too long:
> localhost/127.0.0.1:61616
>
>      at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
> java:62)
>
> ...
>
> org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSh
> aredConnection(AbstractJmsListeningContainer.java:385)
>
>      at
> org.springframework.jms.listener.SimpleMessageListenerContainer.onExcept
> ion(SimpleMessageListenerContainer.java:206)
>
>      at
> org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:177
> 9)
>
>      ...
>
> Caused by: org.apache.activemq.transport.InactivityIOException: Channel
> was inactive for too long: localhost/127.0.0.1:61616
>
>      at
> org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor
> .java:225)
>
>      at
> org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.jav
> a:83)
>
>      at
> org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego
> tiator.java:100)
>
>      at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:
> 40)
>
>      at
> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelat
> or.java:60)
>
>      at
> org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnect
> ion.java:1214)
>
>      ... 10 more
>
>
>
>
>
>
>
>      <bean id="activemq"
> class="org.apache.camel.component.jms.JmsComponent">
>
>            <property name="connectionFactory">
>
>                  <bean
> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>
>                        <property name="brokerURL"
> value="tcp://localhost:61616?wireFormat.maxInactivityDuration=0" />
>
>                        <property name="closeTimeout" value="0"/>
>
>                  </bean>
>
>            </property>
>
>      </bean>
>
>
>
>      <broker:broker useJmx="false" persistent="false"
> brokerName="localhost">
>
>        <broker:transportConnectors>
>
>            <broker:transportConnector name="tcp"
> uri="tcp://localhost:61616"/>
>
>        </broker:transportConnectors>
>
>    </broker:broker>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/