You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jwuelker <jw...@de.hellmann.net> on 2011/04/12 15:46:01 UTC

NotifyBuilder and MockEndpoint question

I have a unit-test for a route that uses a MockEndpoint and waits 5 sec with
Thread.sleep() for 1 message to be finished. This works, but  now i want to
use the NotifyBuilder  instead. But instead of 1 Message the MockEndpoint
receives 3 (i think its the original message and the target message twice).
if i use NotifyBuilder  but replace the MockEndpoint with the file-component
(fileExist=Fail) everything works fine again, no error but 1 file is
written. Did anyone already experienced this and can tell me what to do?

--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-and-MockEndpoint-question-tp4298229p4298229.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder and MockEndpoint question

Posted by jwuelker <jw...@de.hellmann.net>.
I have these lines now and it works:
MockEndpoint endpoint = getMockEndpoint("{{out}}");
...
NotifyBuilder notify = new
NotifyBuilder(camelContext).from("{{out}}").whenDoneSatisfied(endpoint).create();

This looks a bit strange to me, because i use the out-endpoint twice. First
is thought if have to use the from-endpoint for the from(...)-method. 
Are the 2 lines correct?


--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-and-MockEndpoint-question-tp4298229p4298296.html
Sent from the Camel - Users mailing list archive at Nabble.com.