You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Paul Gale <pa...@gmail.com> on 2014/06/23 20:22:28 UTC

Camel hang on graceful shutdown - NOT trying to stop a route from a route

Hi,

ActiveMQ 5.9.1
Camel 2.13.1
Spring 3.2.5
OS: RHEL 6.3
Tanuki Java Service Wrapper 3.5.24

When I shutdown my broker inside which a Camel context is containing just
one route (shown below) it hangs. The route connects to a topic on a remote
broker and writes out the messages to a queue on the local broker. The
route is about as simple as it gets.

At the time of the hang I get that good old chestnut of a message:

"Still waiting for shutdown of 1 message listener invokers"

After a timeout the Java Service Wrapper kills the broker process - not
good. After some Googling I've seen where others have reported this error
before.

However, the difference here is that I am NOT trying to stop a route from
another route (at least it doesn't look like I am) and yet I still get the
same hang. I am simply trying to stop the broker which should gracefully
shutdown the one route in the Camel context when the broker shuts down.

Clearly I am missing something. Thoughts?

Thanks,
Paul

Here is my camel.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://camel.apache.org/schema/spring

http://camel.apache.org/schema/spring/camel-spring.xsd">

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="locations">
      <list>
        <value>file:${activemq.conf}/credentials.properties</value>
        <value>file:${activemq.conf}/developer.testing.properties</value>
      </list>
    </property>
  </bean>

  <!-- Connect to remote broker -->
  <bean id="remote.activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL"
value="failover:(tcp://queue01.inf.man-${source.environment}.ove.local:61616,tcp://queue02.inf.man-${source.environment}.ove.local:61616)?randomize=false"/>
    <property name="userName" value="${activemq.username}"/>
    <property name="password" value="${activemq.password}"/>
  </bean>

  <!-- Connect to local broker -->
  <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL"
value="vm://localhost?create=false&amp;waitForStart=10000"/>
    <property name="userName" value="${activemq.username}"/>
    <property name="password" value="${activemq.password}"/>
  </bean>

  <bean id="shutdown" class="org.apache.camel.impl.DefaultShutdownStrategy">
    <property name="timeout" value="15"/>
    <property name="suppressLoggingOnTimeout" value="true"/>
  </bean>

  <camelContext id="camel.dev" autoStartup="${camel.auto.startup}"
xmlns="http://camel.apache.org/schema/spring">
    <propertyPlaceholder id="properties"
location="developer.testing.properties"/>

    <route>
      <from uri="remote.activemq:topic:{{source.topic}}?clientId={{client.id.prefix}}_camel_client"/>
      <to uri="activemq:{{source.topic}}.browse"/>
    </route>
  </camelContext>
</beans>

Re: Camel hang on graceful shutdown - NOT trying to stop a route from a route

Posted by Paul Gale <pa...@gmail.com>.
Thanks for the suggestion.

I tried it but unfortunately it didn't fix anything. I even included the
broker tag id in the list of 'depends-on' without success.

Anyone else have thoughts on this?

Thanks,
Paul



On Tue, Jun 24, 2014 at 12:55 AM, boday <be...@initekconsulting.com>
wrote:

> you might try adding a "depends-on" attribute to the <camelContext>
> definition to tell Spring the order to start/stop things...
>
> <camelContext id="camel.dev" autoStartup="${camel.auto.startup}"
> xmlns="http://camel.apache.org/schema/spring" depends-on="activemq,
> remote.activemq">
>
>
> Paul Gale wrote
> > Hi,
> >
> > ActiveMQ 5.9.1
> > Camel 2.13.1
> > Spring 3.2.5
> > OS: RHEL 6.3
> > Tanuki Java Service Wrapper 3.5.24
> >
> > When I shutdown my broker inside which a Camel context is containing just
> > one route (shown below) it hangs. The route connects to a topic on a
> > remote
> > broker and writes out the messages to a queue on the local broker. The
> > route is about as simple as it gets.
> >
> > At the time of the hang I get that good old chestnut of a message:
> >
> > "Still waiting for shutdown of 1 message listener invokers"
> >
> > After a timeout the Java Service Wrapper kills the broker process - not
> > good. After some Googling I've seen where others have reported this error
> > before.
> >
> > However, the difference here is that I am NOT trying to stop a route from
> > another route (at least it doesn't look like I am) and yet I still get
> the
> > same hang. I am simply trying to stop the broker which should gracefully
> > shutdown the one route in the Camel context when the broker shuts down.
> >
> > Clearly I am missing something. Thoughts?
> >
> > Thanks,
> > Paul
> >
> > Here is my camel.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <beans xmlns="http://www.springframework.org/schema/beans"
> >        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >        xsi:schemaLocation="http://www.springframework.org/schema/beans
> >
> > http://www.springframework.org/schema/beans/spring-beans.xsd
> >                            http://camel.apache.org/schema/spring
> >
> > http://camel.apache.org/schema/spring/camel-spring.xsd">
> >
> > <bean
> >
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> >
> > <property name="ignoreUnresolvablePlaceholders" value="true"/>
> >
> > <property name="locations">
> >
> > <list>
> >
> > <value>
> > file:${activemq.conf}/credentials.properties
> > </value>
> >
> > <value>
> > file:${activemq.conf}/developer.testing.properties
> > </value>
> >
> > </list>
> >
> > </property>
> >
> > </bean>
> >
>
> >
> > <bean id="remote.activemq"
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
> >
> > <property name="brokerURL"
> >
> value="failover:(tcp://queue01.inf.man-${source.environment}.ove.local:61616,tcp://queue02.inf.man-${source.environment}.ove.local:61616)?randomize=false"/>
> >
> > <property name="userName" value="${activemq.username}"/>
> >
> > <property name="password" value="${activemq.password}"/>
> >
> > </bean>
> >
>
> >
> > <bean id="activemq"
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
> >
> > <property name="brokerURL"
> > value="vm://localhost?create=false&amp;waitForStart=10000"/>
> >
> > <property name="userName" value="${activemq.username}"/>
> >
> > <property name="password" value="${activemq.password}"/>
> >
> > </bean>
> >
> > <bean id="shutdown"
> class="org.apache.camel.impl.DefaultShutdownStrategy">
> >
> > <property name="timeout" value="15"/>
> >
> > <property name="suppressLoggingOnTimeout" value="true"/>
> >
> > </bean>
> >
> > <camelContext id="camel.dev" autoStartup="${camel.auto.startup}"
> > xmlns="http://camel.apache.org/schema/spring">
> >
> > <propertyPlaceholder id="properties"
> > location="developer.testing.properties"/>
> >
> > <route>
> >
> > <from
> >
> uri="remote.activemq:topic:{{source.topic}}?clientId={{client.id.prefix}}_camel_client"/>
> >
> > <to uri="activemq:{{source.topic}}.browse"/>
> >
> > </route>
> >
> > </camelContext>
> > </beans>
>
>
>
>
>
> -----
> Ben O'Day
> IT Consultant -http://consulting-notes.com
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-hang-on-graceful-shutdown-NOT-trying-to-stop-a-route-from-a-route-tp5752711p5752722.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel hang on graceful shutdown - NOT trying to stop a route from a route

Posted by boday <be...@initekconsulting.com>.
you might try adding a "depends-on" attribute to the <camelContext>
definition to tell Spring the order to start/stop things...

<camelContext id="camel.dev" autoStartup="${camel.auto.startup}"
xmlns="http://camel.apache.org/schema/spring" depends-on="activemq,
remote.activemq">


Paul Gale wrote
> Hi,
> 
> ActiveMQ 5.9.1
> Camel 2.13.1
> Spring 3.2.5
> OS: RHEL 6.3
> Tanuki Java Service Wrapper 3.5.24
> 
> When I shutdown my broker inside which a Camel context is containing just
> one route (shown below) it hangs. The route connects to a topic on a
> remote
> broker and writes out the messages to a queue on the local broker. The
> route is about as simple as it gets.
> 
> At the time of the hang I get that good old chestnut of a message:
> 
> "Still waiting for shutdown of 1 message listener invokers"
> 
> After a timeout the Java Service Wrapper kills the broker process - not
> good. After some Googling I've seen where others have reported this error
> before.
> 
> However, the difference here is that I am NOT trying to stop a route from
> another route (at least it doesn't look like I am) and yet I still get the
> same hang. I am simply trying to stop the broker which should gracefully
> shutdown the one route in the Camel context when the broker shuts down.
> 
> Clearly I am missing something. Thoughts?
> 
> Thanks,
> Paul
> 
> Here is my camel.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
> 
> http://www.springframework.org/schema/beans/spring-beans.xsd
>                            http://camel.apache.org/schema/spring
> 
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>   
> <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>     
> <property name="ignoreUnresolvablePlaceholders" value="true"/>
>     
> <property name="locations">
>       
> <list>
>         
> <value>
> file:${activemq.conf}/credentials.properties
> </value>
>         
> <value>
> file:${activemq.conf}/developer.testing.properties
> </value>
>       
> </list>
>     
> </property>
>   
> </bean>
>   

>   
> <bean id="remote.activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>     
> <property name="brokerURL"
> value="failover:(tcp://queue01.inf.man-${source.environment}.ove.local:61616,tcp://queue02.inf.man-${source.environment}.ove.local:61616)?randomize=false"/>
>     
> <property name="userName" value="${activemq.username}"/>
>     
> <property name="password" value="${activemq.password}"/>
>   
> </bean>
>   

>   
> <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>     
> <property name="brokerURL"
> value="vm://localhost?create=false&amp;waitForStart=10000"/>
>     
> <property name="userName" value="${activemq.username}"/>
>     
> <property name="password" value="${activemq.password}"/>
>   
> </bean>
>   
> <bean id="shutdown" class="org.apache.camel.impl.DefaultShutdownStrategy">
>     
> <property name="timeout" value="15"/>
>     
> <property name="suppressLoggingOnTimeout" value="true"/>
>   
> </bean>
>   
> <camelContext id="camel.dev" autoStartup="${camel.auto.startup}"
> xmlns="http://camel.apache.org/schema/spring">
>     
> <propertyPlaceholder id="properties"
> location="developer.testing.properties"/>
>     
> <route>
>       
> <from
> uri="remote.activemq:topic:{{source.topic}}?clientId={{client.id.prefix}}_camel_client"/>
>       
> <to uri="activemq:{{source.topic}}.browse"/>
>     
> </route>
>   
> </camelContext>
> </beans>





-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-hang-on-graceful-shutdown-NOT-trying-to-stop-a-route-from-a-route-tp5752711p5752722.html
Sent from the Camel - Users mailing list archive at Nabble.com.