camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Gale <paul.n.g...@gmail.com>
Subject Camel hang on graceful shutdown - NOT trying to stop a route from a route
Date Mon, 23 Jun 2014 18:22:28 GMT
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>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message