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.

Reply via email to