camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: NotifyBuilder condition fails to match on an out/activemq endpoint
Date Sun, 14 Aug 2011 11:54:01 GMT
Hi

On Fri, Aug 12, 2011 at 1:11 PM, jason.parr <jason.parr@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/

Mime
View raw message