Hi, I am having problems stopping a camel route which pushes messages from a queue in broker1 to another queue in broker2. I am using Apache Camel 2.7.1-fuse-00-27 that ships with ActiveMQ 5.5.0-fuse-00-27.
The problem comes when there are inflight messages. This happens if broker2 is offline (because of maintenance or networking problems). When I click on stop button for the route in broker1 when broker2 is unreachable, I can see PooledConnectionFactory still trying to connect to broker2 even after I get "Route: route1 shutdown complete" in the log file. I've setup DefaultShutdownStrategy for camel to wait inflight operations for 10 seconds and shutdown. After 10 seconds Camel emits "Route route1 shutdown complete" message but immediately after that line I can see PooledConnectionFactory repeating (indefinitely): Still waiting for shutdown of 16 message listener invokers | org.apache.camel.component.jms.JmsMessageListenerContainer Failed delivery for exchangeId: XXX On delivery attempt: 0 caught: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://broker2:61616. Reason: java.net.ConnectException: Connection timed out: connect | org.apache.camel.processor.DefaultErrorHandler While these messages are being emitted, camel admin "routes" page becomes unresponsive (Jetty does not fail as I can still access Endpoints page). The only way of ending this loop is to shutdown activemq altogether. My camel configuration can be found here: http://camel.465427.n5.nabble.com/file/n4689384/camel.xml Complete log can be found here: http://camel.465427.n5.nabble.com/file/n4689384/activemq.log Is there anything I can do to let camel try to complete inflight messages for x seconds (e.g. 10 seconds as in my config) and stop the route? I should then have the option to start it again. Cheers, Ozan -- View this message in context: http://activemq.2283324.n4.nabble.com/Camel-route-stop-when-messages-inflight-tp3755663p3755663.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.