You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mick Knutson <mk...@baselogic.com> on 2008/10/08 01:48:52 UTC

timeToLive on a queue

I want to send a message to a queue, then if the message is not picked up in
the allotted time frame, forward the errored message to my
DeadLetterChannel.

here is my routing:

*    public static final String CHANNEL_GG_CS_COMMAND_TIMEOUT =
"activemq:queue:channel/command/timeout?timeToLive=545000";

        from(Constants.CHANNEL_GG_CS_TAP)
                .to(Constants.CHANNEL_GG_CS_COMMAND_TIMEOUT);

        from(Constants.CHANNEL_GG_CS_COMMAND_TIMEOUT)
                .errorHandler(

deadLetterChannel(Constants.CHANNEL_GG_CS_COMMAND_STATUS_ERROR) // need to
direct this to timeoutProcessor
                                .loggingLevel(LoggingLevel.INFO)
                ).transform(body().append(" *** TIMEOUT EXCEPTION ***")); //
does not get consumed as we want to wait for a timeout


*

But when I send a message to the timeout queue, is seems to immediately be
an DLC

*[ltMessageListenerContainer-244] EndpointMessageListener        DEBUG
Endpoint[activemq:queue:channel/gogrid/cloudstorage/command/timeout?timeToLive=5
5000] consumer receiving JMS message: ActiveMQTextMessage {commandId = 5,
responseRequired = true, messageId = ID:mickknutson-1507-1223421985269-0:11:
1:1:1, originalDestination = null, originalTransactionId = null, producerId
= ID:mickknutson-1507-1223421985269-0:11:1:1, destination = queue://channe
l/gogrid/cloudstorage/command/timeout, transactionId = null, expiration =
1223422281505, timestamp = 1223422226505, arrival = 0, brokerInTime = 122342
2226884, brokerOutTime = 1223422226942, correlationId = null, replyTo =
null, persistent = true, type = null, priority = 4, groupID = null,
groupSeque
nce = 0, targetConsumerId = null, compressed = false, userID = null, content
= org.apache.activemq.util.ByteSequence@1a488, marshalledProperties = org
.apache.activemq.util.ByteSequence@1d8ef2f, dataStructure = null,
redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties =
true, readO
nlyBody = true, droppable = false, text = null}
[ltMessageListenerContainer-244] EndpointMessageListener        DEBUG Cannot
send reply message as there is no replyDestination for: JmsMessage: {"com
mandType":"jobStatus","status":"succeeded","message":{"customerId":"16323"},"changeRequestId":"4322","jobId":"ebd47e58-94c7-11dd-b4f0-0030488bd1fd"}
*
** TIMEOUT EXCEPTION ***
*

and never seems to get routed to *CHANNEL_GG_CS_COMMAND_STATUS_ERROR either.
*

-- 
---
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com

Re: timeToLive on a queue

Posted by James Strachan <ja...@gmail.com>.
If a JMS provider times out messages on a DLQ, the Camel route is
unaware of such a thing - as the JMS broker does this - not the camel
route (which is always gonna be a JMS client).

So if you want a time to live on messages you need to use the ActiveMQ
DLQ to consume timeout errors - not use Camel's own DLQ mechanism.

2008/10/8 Mick Knutson <mk...@baselogic.com>:
> I want to send a message to a queue, then if the message is not picked up in
> the allotted time frame, forward the errored message to my
> DeadLetterChannel.
>
> here is my routing:
>
> *    public static final String CHANNEL_GG_CS_COMMAND_TIMEOUT =
> "activemq:queue:channel/command/timeout?timeToLive=545000";
>
>        from(Constants.CHANNEL_GG_CS_TAP)
>                .to(Constants.CHANNEL_GG_CS_COMMAND_TIMEOUT);
>
>        from(Constants.CHANNEL_GG_CS_COMMAND_TIMEOUT)
>                .errorHandler(
>
> deadLetterChannel(Constants.CHANNEL_GG_CS_COMMAND_STATUS_ERROR) // need to
> direct this to timeoutProcessor
>                                .loggingLevel(LoggingLevel.INFO)
>                ).transform(body().append(" *** TIMEOUT EXCEPTION ***")); //
> does not get consumed as we want to wait for a timeout
>
>
> *
>
> But when I send a message to the timeout queue, is seems to immediately be
> an DLC
>
> *[ltMessageListenerContainer-244] EndpointMessageListener        DEBUG
> Endpoint[activemq:queue:channel/gogrid/cloudstorage/command/timeout?timeToLive=5
> 5000] consumer receiving JMS message: ActiveMQTextMessage {commandId = 5,
> responseRequired = true, messageId = ID:mickknutson-1507-1223421985269-0:11:
> 1:1:1, originalDestination = null, originalTransactionId = null, producerId
> = ID:mickknutson-1507-1223421985269-0:11:1:1, destination = queue://channe
> l/gogrid/cloudstorage/command/timeout, transactionId = null, expiration =
> 1223422281505, timestamp = 1223422226505, arrival = 0, brokerInTime = 122342
> 2226884, brokerOutTime = 1223422226942, correlationId = null, replyTo =
> null, persistent = true, type = null, priority = 4, groupID = null,
> groupSeque
> nce = 0, targetConsumerId = null, compressed = false, userID = null, content
> = org.apache.activemq.util.ByteSequence@1a488, marshalledProperties = org
> .apache.activemq.util.ByteSequence@1d8ef2f, dataStructure = null,
> redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties =
> true, readO
> nlyBody = true, droppable = false, text = null}
> [ltMessageListenerContainer-244] EndpointMessageListener        DEBUG Cannot
> send reply message as there is no replyDestination for: JmsMessage: {"com
> mandType":"jobStatus","status":"succeeded","message":{"customerId":"16323"},"changeRequestId":"4322","jobId":"ebd47e58-94c7-11dd-b4f0-0030488bd1fd"}
> *
> ** TIMEOUT EXCEPTION ***
> *
>
> and never seems to get routed to *CHANNEL_GG_CS_COMMAND_STATUS_ERROR either.
> *
>
> --
> ---
> Thank You…
>
> Mick Knutson
> BASE Logic, inc.
> (415) 354-4215
>
> Website: http://baselogic.com
> Blog: http://baselogic.com/blog
> BLiNC Magazine: http://blincmagazine.com
> Linked IN: http://linkedin.com/in/mickknutson
> DJ Mick: http://djmick.com
> MySpace: http://myspace.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com