You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "jason.parr" <ja...@usa.net> on 2011/08/11 12:07:25 UTC

NotifyBuilder condition fails to match on an out/activemq endpoint

Is it possible to get NotifyBuilder to wait on message arrival at various
out/edge jms endpoints within a test? Surely this is what you want to do
most of the time?, ie check your end conditions.

In all the NotifyBuilder examples I've seen the notify conditions are either
very general or on components that are at the start or mid route.

In the test shown (at the end of this email) the properties
{{url.radial-trades}} & {{url.dead-letter}} are expanded to vm/activemq
queues.

The NotifyBuilder's condition never fires and always times out. Now I can
get this working by adding a very general condition and a sleep:

    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    boolean matches = notify.create().matches(10, TimeUnit.SECONDS);          
    Thread.sleep(1000);
    // Now assert on browsable queues    

But having that sleep makes the test nondeterministic in my opinion - what
happens if a full GC during test makes it run slower etc. I really dont like
the sleep!

I've tried all of whenDone, whenReceived, whenComplete etc but condition
never fires when expression is on an out endpoint url.

As an aside I noticed that property expansion does not fail/exception with
NotifyBuilder when it is given rubbish, eg:

 NotifyBuilder notify = new NotifyBuilder(context)
      .from("{{this-does-not-exist}}").whenDone(1).create();


Code of failing test due to timeout:
------------------------------------------

/**
 * Test for {@link RadialRouteBuilder}
 */
public class RadialRouteBuilderTestCase extends CamelTestSupport {

  private JndiRegistry registry;

  @Test
  public void testCompleteRoute() throws Exception {

    // Test has completed when all expected trades have hit external
endpoints
    NotifyBuilder notify = new NotifyBuilder(context)
      .from("{{url.radial-trades}}").whenDone(4)
      .from("{{url.dead-letter}}").whenDone(1).create();

    // Fail on timeout after 10 seconds
    boolean matches = notify.create().matches(10, TimeUnit.SECONDS);
    assertTrue("Expected four trade messages to be produced and one dead
letter message", matches);


    // Never get here

    BrowsableEndpoint radialTradesEP =
context.getEndpoint("{{url.radial-trades}}", BrowsableEndpoint.class);
    assertEquals("Radial Trade Messages", 4,
radialTradesEP.getExchanges().size());

    BrowsableEndpoint deadLetterEP =
context.getEndpoint("{{url.dead-letter}}", BrowsableEndpoint.class);
    assertEquals("Dead Letter Messages", 1,
deadLetterEP.getExchanges().size());
  }

  @Override
  protected RouteBuilder createRouteBuilder() throws Exception {
    return new RadialRouteBuilder() {
      @Override
      public void configure() {
        super.configure();
        //Play trades into route's jms queues via an embedded jms broker
       
from("file:src/test/data/radial-route-builder-test-case?noop=true&include=bond_msg.*")
          .to("{{url.tradebus-bond-trades}}");
       
from("file:src/test/data/radial-route-builder-test-case?noop=true&include=future_msg.*")
          .to("{{url.tradebus-future-trades}}");
      }
    };
  }

  @Override
  protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();

    //Configure active mq to use embedded broker
    context.addComponent("activemq",
activeMQComponent("vm://localhost?broker.persistent=false"));

    // Load test specific properties
    PropertiesComponent properties =
context.getComponent("properties",PropertiesComponent.class);
    properties.setLocations(new String[]{
      "file:config/config-dev.properties",
      "file:src/test/config/config-test.properties"});

    // Setup spring beans
    RadialBondTradeEventProcessor bondTEP = new
RadialBondTradeEventProcessor();
    bondTEP.setTradeCache(new BasicTradeCache<BondTrade>());
    registry.bind("bondTradeEventProcessor", bondTEP);
    RadialFutureTradeEventProcessor futureTEP = new
RadialFutureTradeEventProcessor();
    futureTEP.setTradeCache(new BasicTradeCache<FutureTrade>());
    registry.bind("futureTradeEventProcessor", futureTEP);

    return context;
  }

  @Override
  protected JndiRegistry createRegistry() throws Exception {
    // Store registry so can register spring beans later
    registry = super.createRegistry();
    return registry;    //To change body of overridden methods use File |
Settings | File Templates.
  }
}







--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4689038.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Aug 12, 2011 at 1:11 PM, jason.parr <ja...@usa.net> wrote:
>
> What I'm trying to do is use my 'production' route unchanged within the test
> - or as close as possible.
>
> My application has a couple of input jms queues and two output queues, one
> for successful messages the other is an error queue. I send messages via jms
> into the route from pre-recorded messages stored in files and accessed by
> the file component.
>
> I want to run my test and check that the output queues have exactly the
> correct amount of messages on them that I expected. I could change the 'out'
> jms queue endpoints to be mocks but I'd rather they really are jms endpoints
> configured to use an embedded activemq broker, as this is as close to real
> deployment as possible.
>
> So something like:
>
>    whenExactlyDone(5).wereSentTo("jms:good-msgs")
>      .and()
>    whenExactlyDone(1).wereSentTo("jms:bad-msgs").create();
>

Yeah something like that ought to be possible to create. Fell free to
create a JIRA with this improvement.


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692881.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
Raised: https://issues.apache.org/jira/browse/CAMEL-4551

--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4909336.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah you may have a point. Can you create a JIRA ticket? Will look
into this when I get back to my office. I am traveling this week.

On Mon, Oct 10, 2011 at 11:02 AM, jason.parr <ja...@usa.net> wrote:
> Without any further changes the new wereSentTo added for 2.9 seems of very
> limited use as previously posted it fires too eagerly.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4887499.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
Without any further changes the new wereSentTo added for 2.9 seems of very
limited use as previously posted it fires too eagerly.

--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4887499.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
I took a while to test this but the new wereSentTo condition matches too
eagerly, in your above example whenDone matches on any received message on
any endpoint and then the first wereSentTo match forces the whole predicate
to be true. What if you want is to wait for a number of messages just like
whenDone?

Need something like:

Eg:

public NotifyBuilder wereSentTo(final String endpointUri, *final int
number*) {
        stack.push(new EventPredicateSupport() {
            private int current;

            @Override
            public boolean onExchangeSent(Exchange exchange, Endpoint
endpoint, long timeTaken) {
                if (EndpointHelper.matchEndpoint(endpoint.getEndpointUri(),
endpointUri)) {
                    // we should match if matching once
                    current++;
                }
                return false;
            }

            public boolean matches() {
                return current >= number;
            }

            @Override
            public void reset() {
                matches = false;
            }

            @Override
            public String toString() {
                return "wereSentTo(" + endpointUri + ")";
            }
        });
        return this;
    }

Then can do as expected:

        NotifyBuilder notify = new NotifyBuilder(context)
.wereSentTo("jms:queue:CAPTURED.MESSAGES", *5*);

Whilst the current camel 2.9 code with 

        NotifyBuilder notify = new NotifyBuilder(context) 
          .whenDone(5).wereSentTo("jms:queue:CAPTURED.MESSAGES");

Fires on first message reaching CAPTURED.MESSAGES not after the required 5.

Also noticed that variable expansion of urls doesnt seem to happen in the
NotifyBuilder.

--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4867857.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

On Fri, Aug 12, 2011 at 1:11 PM, jason.parr <ja...@usa.net> wrote:
>
> What I'm trying to do is use my 'production' route unchanged within the test
> - or as close as possible.
>
> My application has a couple of input jms queues and two output queues, one
> for successful messages the other is an error queue. I send messages via jms
> into the route from pre-recorded messages stored in files and accessed by
> the file component.
>
> I want to run my test and check that the output queues have exactly the
> correct amount of messages on them that I expected. I could change the 'out'
> jms queue endpoints to be mocks but I'd rather they really are jms endpoints
> configured to use an embedded activemq broker, as this is as close to real
> deployment as possible.
>
> So something like:
>
>    whenExactlyDone(5).wereSentTo("jms:good-msgs")
>      .and()
>    whenExactlyDone(1).wereSentTo("jms:bad-msgs").create();
>

I have just implemented this as a new feature in Camel 2.9. This is
from an unit test

        // we expect 2+ done messages which were sent to mock:bar
        // and 1+ failed message which were sent to mock:fail
        NotifyBuilder notify = new NotifyBuilder(context)
                .whenDone(2).wereSentTo("mock:bar")
                .and()
                .whenFailed(1).wereSentTo("mock:fail")
                .create();



>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692881.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
What I'm trying to do is use my 'production' route unchanged within the test
- or as close as possible.

My application has a couple of input jms queues and two output queues, one
for successful messages the other is an error queue. I send messages via jms
into the route from pre-recorded messages stored in files and accessed by
the file component. 

I want to run my test and check that the output queues have exactly the
correct amount of messages on them that I expected. I could change the 'out'
jms queue endpoints to be mocks but I'd rather they really are jms endpoints
configured to use an embedded activemq broker, as this is as close to real
deployment as possible. 

So something like:

    whenExactlyDone(5).wereSentTo("jms:good-msgs")
      .and()
    whenExactlyDone(1).wereSentTo("jms:bad-msgs").create();



--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692881.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Aug 12, 2011 at 11:09 AM, jason.parr <ja...@usa.net> wrote:
> Hi,
>
> The suggestion is nod valid in java DSL, ie:
>
>    NotifyBuilder notify = new NotifyBuilder(context)
>      .whenDone(NUMBER_OF_GOOD_TRADES).to("{{url.radial-trades}}").create();
>
> Did you mean this is something that could be added camel? or is available in
> later version of camel? We're on 2.8.0
>

Yeah it was an idea for a improvement in Camel 2.9.

Just wanted to play a bit with the API to make sure we understand your
use-case and that the API
seems right and understandable what it does.

Feedback and suggestions welcome.

Maybe instead of .to we need a more expressive name

.wasSentTo
.hasBeenSentTo
.sentTo
.sentToEndpoint

???

> Thanks
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692582.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
Hi,

The suggestion is nod valid in java DSL, ie:

    NotifyBuilder notify = new NotifyBuilder(context)
      .whenDone(NUMBER_OF_GOOD_TRADES).to("{{url.radial-trades}}").create();

Did you mean this is something that could be added camel? or is available in
later version of camel? We're on 2.8.0

Thanks


--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692582.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 11, 2011 at 12:07 PM, jason.parr <ja...@usa.net> wrote:
> Is it possible to get NotifyBuilder to wait on message arrival at various
> out/edge jms endpoints within a test? Surely this is what you want to do
> most of the time?, ie check your end conditions.
>

When you say out/edge you mean when X number of messages has been
*send* to this endpoint?

We should be able to track that by keeping an eye on the
ExchangeSentEvent notifications
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/event/ExchangeSentEvent.html

So if you could do something like this. To say that notify when 5
exchange is done, and all the exchanges, was send to the given
endpoint.
NotifyBuilder notify = whenDone(5).to("activemq:queue:foo").create();



> In all the NotifyBuilder examples I've seen the notify conditions are either
> very general or on components that are at the start or mid route.
>
> In the test shown (at the end of this email) the properties
> {{url.radial-trades}} & {{url.dead-letter}} are expanded to vm/activemq
> queues.
>
> The NotifyBuilder's condition never fires and always times out. Now I can
> get this working by adding a very general condition and a sleep:
>
>    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
>    boolean matches = notify.create().matches(10, TimeUnit.SECONDS);
>    Thread.sleep(1000);
>    // Now assert on browsable queues
>
> But having that sleep makes the test nondeterministic in my opinion - what
> happens if a full GC during test makes it run slower etc. I really dont like
> the sleep!
>
> I've tried all of whenDone, whenReceived, whenComplete etc but condition
> never fires when expression is on an out endpoint url.
>
> As an aside I noticed that property expansion does not fail/exception with
> NotifyBuilder when it is given rubbish, eg:
>
>  NotifyBuilder notify = new NotifyBuilder(context)
>      .from("{{this-does-not-exist}}").whenDone(1).create();
>
>
> Code of failing test due to timeout:
> ------------------------------------------
>
> /**
>  * Test for {@link RadialRouteBuilder}
>  */
> public class RadialRouteBuilderTestCase extends CamelTestSupport {
>
>  private JndiRegistry registry;
>
>  @Test
>  public void testCompleteRoute() throws Exception {
>
>    // Test has completed when all expected trades have hit external
> endpoints
>    NotifyBuilder notify = new NotifyBuilder(context)
>      .from("{{url.radial-trades}}").whenDone(4)
>      .from("{{url.dead-letter}}").whenDone(1).create();
>
>    // Fail on timeout after 10 seconds
>    boolean matches = notify.create().matches(10, TimeUnit.SECONDS);
>    assertTrue("Expected four trade messages to be produced and one dead
> letter message", matches);
>
>
>    // Never get here
>
>    BrowsableEndpoint radialTradesEP =
> context.getEndpoint("{{url.radial-trades}}", BrowsableEndpoint.class);
>    assertEquals("Radial Trade Messages", 4,
> radialTradesEP.getExchanges().size());
>
>    BrowsableEndpoint deadLetterEP =
> context.getEndpoint("{{url.dead-letter}}", BrowsableEndpoint.class);
>    assertEquals("Dead Letter Messages", 1,
> deadLetterEP.getExchanges().size());
>  }
>
>  @Override
>  protected RouteBuilder createRouteBuilder() throws Exception {
>    return new RadialRouteBuilder() {
>      @Override
>      public void configure() {
>        super.configure();
>        //Play trades into route's jms queues via an embedded jms broker
>
> from("file:src/test/data/radial-route-builder-test-case?noop=true&include=bond_msg.*")
>          .to("{{url.tradebus-bond-trades}}");
>
> from("file:src/test/data/radial-route-builder-test-case?noop=true&include=future_msg.*")
>          .to("{{url.tradebus-future-trades}}");
>      }
>    };
>  }
>
>  @Override
>  protected CamelContext createCamelContext() throws Exception {
>    CamelContext context = super.createCamelContext();
>
>    //Configure active mq to use embedded broker
>    context.addComponent("activemq",
> activeMQComponent("vm://localhost?broker.persistent=false"));
>
>    // Load test specific properties
>    PropertiesComponent properties =
> context.getComponent("properties",PropertiesComponent.class);
>    properties.setLocations(new String[]{
>      "file:config/config-dev.properties",
>      "file:src/test/config/config-test.properties"});
>
>    // Setup spring beans
>    RadialBondTradeEventProcessor bondTEP = new
> RadialBondTradeEventProcessor();
>    bondTEP.setTradeCache(new BasicTradeCache<BondTrade>());
>    registry.bind("bondTradeEventProcessor", bondTEP);
>    RadialFutureTradeEventProcessor futureTEP = new
> RadialFutureTradeEventProcessor();
>    futureTEP.setTradeCache(new BasicTradeCache<FutureTrade>());
>    registry.bind("futureTradeEventProcessor", futureTEP);
>
>    return context;
>  }
>
>  @Override
>  protected JndiRegistry createRegistry() throws Exception {
>    // Store registry so can register spring beans later
>    registry = super.createRegistry();
>    return registry;    //To change body of overridden methods use File |
> Settings | File Templates.
>  }
> }
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4689038.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by "jason.parr" <ja...@usa.net>.
Hi,

No that didnt make any difference.

The mesages are going where expected just the notify condition never fire.

I'm using camel 2.8.0

The 'prod' route builder I'm testing who's configure was over-ridden to read
inputs from files is:


  public void configure() {

    errorHandler(
      deadLetterChannel("direct:error").useOriginalMessage());

    from("direct:error")
      .log("direct:error")
      .to("log:com?level=ERROR&showAll=true")
      .to("{{url.dead-letter}}");

    from("{{url.tradebus-bond-trades}}")
      .unmarshal(jaxb)
      .to("bean:bondTradeEventProcessor")
      .to("direct:tradebus-trades");

    from("{{url.tradebus-future-trades}}")
      .unmarshal(jaxb)
      .to("bean:futureTradeEventProcessor")
      .to("direct:tradebus-trades");

    from("direct:tradebus-trades")
      .split().body()
      .removeHeaders(".*")
      .to("{{url.radial-trades}}")
      .to("log:com?level=INFO&showBody=true&showHeaders=true");


--
View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4689722.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: NotifyBuilder condition fails to match on an out/activemq endpoint

Posted by Willem Jiang <wi...@gmail.com>.
Hi

Can you change the NotifyBuilder
to be the below one ?

NotifyBuilder notify = new NotifyBuilder(context)
       .from("{{url.radial-trades}}").whenDone(4)
       .and()
       .from("{{url.dead-letter}}").whenDone(1).create()


On 8/11/11 6:07 PM, jason.parr wrote:
> Is it possible to get NotifyBuilder to wait on message arrival at various
> out/edge jms endpoints within a test? Surely this is what you want to do
> most of the time?, ie check your end conditions.
>
> In all the NotifyBuilder examples I've seen the notify conditions are either
> very general or on components that are at the start or mid route.
>
> In the test shown (at the end of this email) the properties
> {{url.radial-trades}}&  {{url.dead-letter}} are expanded to vm/activemq
> queues.
>
> The NotifyBuilder's condition never fires and always times out. Now I can
> get this working by adding a very general condition and a sleep:
>
>      NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
>      boolean matches = notify.create().matches(10, TimeUnit.SECONDS);
>      Thread.sleep(1000);
>      // Now assert on browsable queues
>
> But having that sleep makes the test nondeterministic in my opinion - what
> happens if a full GC during test makes it run slower etc. I really dont like
> the sleep!
>
> I've tried all of whenDone, whenReceived, whenComplete etc but condition
> never fires when expression is on an out endpoint url.
>
> As an aside I noticed that property expansion does not fail/exception with
> NotifyBuilder when it is given rubbish, eg:
>
>   NotifyBuilder notify = new NotifyBuilder(context)
>        .from("{{this-does-not-exist}}").whenDone(1).create();
>
>
> Code of failing test due to timeout:
> ------------------------------------------
>
> /**
>   * Test for {@link RadialRouteBuilder}
>   */
> public class RadialRouteBuilderTestCase extends CamelTestSupport {
>
>    private JndiRegistry registry;
>
>    @Test
>    public void testCompleteRoute() throws Exception {
>
>      // Test has completed when all expected trades have hit external
> endpoints
>      NotifyBuilder notify = new NotifyBuilder(context)
>        .from("{{url.radial-trades}}").whenDone(4)
>        .from("{{url.dead-letter}}").whenDone(1).create();
>
>      // Fail on timeout after 10 seconds
>      boolean matches = notify.create().matches(10, TimeUnit.SECONDS);
>      assertTrue("Expected four trade messages to be produced and one dead
> letter message", matches);
>
>
>      // Never get here
>
>      BrowsableEndpoint radialTradesEP =
> context.getEndpoint("{{url.radial-trades}}", BrowsableEndpoint.class);
>      assertEquals("Radial Trade Messages", 4,
> radialTradesEP.getExchanges().size());
>
>      BrowsableEndpoint deadLetterEP =
> context.getEndpoint("{{url.dead-letter}}", BrowsableEndpoint.class);
>      assertEquals("Dead Letter Messages", 1,
> deadLetterEP.getExchanges().size());
>    }
>
>    @Override
>    protected RouteBuilder createRouteBuilder() throws Exception {
>      return new RadialRouteBuilder() {
>        @Override
>        public void configure() {
>          super.configure();
>          //Play trades into route's jms queues via an embedded jms broker
>
> from("file:src/test/data/radial-route-builder-test-case?noop=true&include=bond_msg.*")
>            .to("{{url.tradebus-bond-trades}}");
>
> from("file:src/test/data/radial-route-builder-test-case?noop=true&include=future_msg.*")
>            .to("{{url.tradebus-future-trades}}");
>        }
>      };
>    }
>
>    @Override
>    protected CamelContext createCamelContext() throws Exception {
>      CamelContext context = super.createCamelContext();
>
>      //Configure active mq to use embedded broker
>      context.addComponent("activemq",
> activeMQComponent("vm://localhost?broker.persistent=false"));
>
>      // Load test specific properties
>      PropertiesComponent properties =
> context.getComponent("properties",PropertiesComponent.class);
>      properties.setLocations(new String[]{
>        "file:config/config-dev.properties",
>        "file:src/test/config/config-test.properties"});
>
>      // Setup spring beans
>      RadialBondTradeEventProcessor bondTEP = new
> RadialBondTradeEventProcessor();
>      bondTEP.setTradeCache(new BasicTradeCache<BondTrade>());
>      registry.bind("bondTradeEventProcessor", bondTEP);
>      RadialFutureTradeEventProcessor futureTEP = new
> RadialFutureTradeEventProcessor();
>      futureTEP.setTradeCache(new BasicTradeCache<FutureTrade>());
>      registry.bind("futureTradeEventProcessor", futureTEP);
>
>      return context;
>    }
>
>    @Override
>    protected JndiRegistry createRegistry() throws Exception {
>      // Store registry so can register spring beans later
>      registry = super.createRegistry();
>      return registry;    //To change body of overridden methods use File |
> Settings | File Templates.
>    }
> }
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4689038.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang