Hi
Ah in Spring XML you gotta inline the nodes to be delayed.
Notice how to to is inside the delay tag.
There is a ticket in JIRA to improve this in Camel 3.0, as we got 3
DSL which acts like this, but its not intuitive
- delay
- throttle
- threads
Which requires the "stuff" to be inside its tag.
<camel:route>
<camel:from uri="activemq:redeliveryQueue"/>
<camel:delay>
<camel:method ref="delayer" method="sendAtTime"/>
<camel:to uri="activemq:testQueue"/>
</camel:delay>
</camel:route>
On Sat, Nov 6, 2010 at 12:59 AM, Krystian <[email protected]> wrote:
>
> I've tried doing something I did with 1.x version of camel, calling a method
> to figure out the delay.
> I can't get that to work though:
>
>
> <bean id="delayer" class="my.DelayerBean"/>
>
> <camel:camelContext id="camel5">
> <!--<camel:routeBuilder ref="redevTest" />-->
> <camel:route>
> <camel:from uri="activemq:redeliveryQueue"/>
> <camel:delay>
> <camel:method ref="delayer" method="sendAtTime"/>
> </camel:delay>
> <camel:to uri="activemq:testQueue"/>
> </camel:route>
> </camel:camelContext>
>
>
> package my
>
> class DelayerBean {
> public long sendAtTime() {
> return System.currentTimeMillis() + 10000
> }
> }
>
>
> There's no delay and if I put a breakpoint in the method I will never get
> there. It's not called.
>
> I've tried changing the <method> to:
> <camel:method bean="delayer" method="sendAtTime"/>
> <camel:method bean="my.DelayerBean" method="sendAtTime"/>
>
> same thing, function is never called.
>
> Any tips?
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Delayer-and-asyncDelayed-how-to-delay-asynchronously-tp3252456p3252679.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/