activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhav Bhargava <unmarsh...@gmail.com>
Subject Re: Camel route stop when messages inflight
Date Fri, 19 Aug 2011 18:09:04 GMT
Hi,

Redelivery policy is configured to try infinite number of times. You need to
specify a value of 10 as per your use case. Now what happens when 10 times
are tried is again a decision that your use case should decide. You can
choose to push that message to a dead letter queue or to some other queue
from where you can restart those failed messages by putting them back into
the main queue when the broker is live again.

Refer:
http://camel.apache.org/exception-clause.html
http://camel.apache.org/dead-letter-channel.html

best Regards,
Madhav

On Fri, Aug 19, 2011 at 10:27 PM, oseymen <ozan.seymen@tdpg.com> wrote:

> 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.
>



-- 
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

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