1
votes

Have a simple route that sends message to the queue. Want to set a timeout for the message being sent to the queue. If the message is not proccessed in say 10 mins then the message should timeout. Tried searching the documentation but could not figure it out. Could someone please help or guide.

Thanks

1
Do you mean that you want a message to time out if it hasn't reached the queue in 10 mins, or that you want it to time out if it hasn't been picked up from the queue in 10 mins?Erik Karlstrand
@noMad17 If it hasnt reached the queue in 10 minsuser5591691
Due to some reason queue becomes full and cannot process that message so want to timeout the message in this scenariouser5591691
That sounds more like an issue with your AMQ configuration, rather than something you should solve in the Camel route. You can configure ActiveMQ to write messages to disk. That way it will take a very long time for it to fill up to a point where it no longer accepts any messages. Look up Message Cursors and Producer Flow Control in the ActiveMQ documentation.Erik Karlstrand
Yes its an ActiveMQ or whatever JMS broker you use type of question. For JMS there is a time to live option but that is only if a message has not been consumed within X time then the message can "self die"Claus Ibsen

1 Answers

0
votes

You can use seda component's timeout option as shown with Spring DSL

<camel:to uri="seda:yourQueue?timeout=600000" /> 

for 10 mins, but an usual timeout is 30secs