On 16/01/2008, melu <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I want to applay "delayer pattern". To practice I work with Apache Camel
> "camel-example-spring" example.
>
> I added "delayer(header("JMSTimestamp"), 30000)" to
> "from("jms:test.MyQueue").to("file://target/test?noop=true");" line so it
> looks like this:
>
> from("jms:test.MyQueue").delayer(header("JMSTimestamp"),
> 30000).to("file://target/test?noop=true");
>
> OK, yes it wokrs, but I have a question:
> Suppose ActiveMQ queue persistance is set to true. Is the message from queue
> peeked and then Apache Camel waits 3 seconds and then it sends the message
> to the target? Or is it done in other way?
Its kinda done like that - the JMS consumer inside Camel consumes the
message as usual, adding the sleep - but then using JMS
acknowledgements or declarative transactions to consume the message
after its been sent on. i.e. its reliable.
> The real question is: What will happen when someting wrong happen between
> peeking a message form queue and delivering it to the target? Will message
> be lost?
No; if the JVM hosting Camel dies, it will be redelivered to another
consumer. JMS queues are reliable load balancers...
http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html
In other words, if a Camel delayer fails to send on the message,
assuming its using Spring based declarative transactions, then it'll
either send the delayed message, or it'll fail and the message will be
redelivered later.
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com