Hi

Try upgrading Camel if you are not using a new version.

See some pointers here
http://camel.apache.org/support.html

On Mon, Feb 15, 2016 at 7:38 PM, Søren Heintzelmann Therkildsen
<soren.heintzelmann.therkild...@systematic.com> wrote:
> Hi.
>
> I am trying to use NotifyBuilder, but I just don't understand it. I have a 
> simple example below that is failing (matches() times out).
>
> Can anyone tell me what I am doing wrong. It must be something simple. :)
>
> import org.apache.camel.Exchange;
> import org.apache.camel.builder.NotifyBuilder;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.impl.DefaultExchange;
> import org.apache.camel.test.junit4.CamelTestSupport;
> import org.junit.Test;
>
> import java.util.concurrent.TimeUnit;
>
> public class RouteNotDone extends CamelTestSupport {
>
>     @Override
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         return new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>
>                 from("direct:a")
>                         .routeId("a")
>                         .log("Finished route a");
>             }
>         };
>     }
>
>     @Test
>     public void testNotDone() {
>         NotifyBuilder nb = new 
> NotifyBuilder(context).fromRoute("a").whenDone(1).create();
>         Exchange exchange = new DefaultExchange(context);
>         exchange = template.send("direct:a", exchange);
>         boolean done = nb.matches(10, TimeUnit.SECONDS);
>         assertTrue("Not done in 10 seconds", done);
>     }
> }



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to