Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
DelayerThe Delayer Pattern allows you to delay the delivery of messages to some destination. The expression is a value in millis to wait from the current time, so the expression should just be See this ticket: https://issues.apache.org/jira/browse/CAMEL-2654 Options
Using the Fluent Builders The example below will delay all messages received on seda:b 1 second before sending them to mock:result. You can just delay things a fixed amount of time from the point at which the delayer receives the message. For example to delay things 2 seconds The above assume that the delivery order is maintained and that the messages are delivered in delay order. If you want to reorder the messages based on delivery time, you can use the Resequencer with this pattern. For example You can of course use many different Expression languages such as XPath, XQuery, SQL or various Scripting Languages. For example to delay the message for the time period specified in the header, use the following syntax: And to delay processing using the Simple language you can use the following DSL: Spring DSLThe sample below demonstrates the delay in Spring DSL: For further examples of this pattern in use you could look at the junit test case Asynchronous delayingAvailable as of Camel 2.4 You can let the Delayer use non blocking asynchronous delaying, which means Camel will use a scheduler to schedule a task to be executed in the future. The task will then continue routing. This allows the caller thread to not block and be able to service other messages etc. From Java DSLYou use the From Spring XMLYou use the Creating a custom delayYou can use an expression to determine when to send a message using something like this then the bean would look like this... See Also |