You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "dr.jeff" <jl...@systechnologies.com> on 2007/04/18 22:14:50 UTC

[camel] Content Based Router

The example as stated does not work:
    public void configure() {
        from("queue:a").choice()
                .when(header("foo").isEqualTo("bar")).to("queue:b")
                .when(header("foo").isEqualTo("cheese")).to("queue:c")
                .otherwise().to("queue:d");
    }

The result is an IllegalStateException from the SendProcessor. It appears to
not have been started during context.start().
-- 
View this message in context: http://www.nabble.com/-camel--Content-Based-Router-tf3603123s2354.html#a10066039
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: [camel] Content Based Router

Posted by James Strachan <ja...@gmail.com>.
On 4/19/07, dr.jeff <jl...@systechnologies.com> wrote:
>
> Works now on Windows XP.
> Tnx.

Thanks for letting us know!

James

>
> James.Strachan wrote:
> >
> > On 4/19/07, dr.jeff <jl...@systechnologies.com> wrote:
> >>
> >> I checked out camel-core this morning (California time) and this problem
> >> appears to be fixed.
> >> However, please note that the build is now failing because of:
> >> Results :
> >>
> >> Failed tests:
> >>   testSendMatchingMessage(org.apache.camel.processor.FilterTest)
> >>
> >> Tests run: 43, Failures: 1, Errors: 0, Skipped: 0
> >
> > That could well be my fault again - sorry about that!
> >
> > I've been trying to improve and rationalise the functional tests; I
> > think I introduced a few timing issues which I've now resolved I
> > think. To help test more reliably I've introduced a MockEndpoint that
> > makes it easy to add expectations in a jMock kind of way, then assert
> > them after a test has completed...
> >
> > http://cwiki.apache.org/CAMEL/mock.html
> >
> > I've tried a build on OS X and Linux and it appears to work - could
> > you try doing a 'svn up' and seeing if its fixed now please?
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/-camel--Content-Based-Router-tf3603123s2354.html#a10084774
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [camel] Content Based Router

Posted by "dr.jeff" <jl...@systechnologies.com>.
Works now on Windows XP.
Tnx.

James.Strachan wrote:
> 
> On 4/19/07, dr.jeff <jl...@systechnologies.com> wrote:
>>
>> I checked out camel-core this morning (California time) and this problem
>> appears to be fixed.
>> However, please note that the build is now failing because of:
>> Results :
>>
>> Failed tests:
>>   testSendMatchingMessage(org.apache.camel.processor.FilterTest)
>>
>> Tests run: 43, Failures: 1, Errors: 0, Skipped: 0
> 
> That could well be my fault again - sorry about that!
> 
> I've been trying to improve and rationalise the functional tests; I
> think I introduced a few timing issues which I've now resolved I
> think. To help test more reliably I've introduced a MockEndpoint that
> makes it easy to add expectations in a jMock kind of way, then assert
> them after a test has completed...
> 
> http://cwiki.apache.org/CAMEL/mock.html
> 
> I've tried a build on OS X and Linux and it appears to work - could
> you try doing a 'svn up' and seeing if its fixed now please?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/-camel--Content-Based-Router-tf3603123s2354.html#a10084774
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: [camel] Content Based Router

Posted by James Strachan <ja...@gmail.com>.
On 4/19/07, dr.jeff <jl...@systechnologies.com> wrote:
>
> I checked out camel-core this morning (California time) and this problem
> appears to be fixed.
> However, please note that the build is now failing because of:
> Results :
>
> Failed tests:
>   testSendMatchingMessage(org.apache.camel.processor.FilterTest)
>
> Tests run: 43, Failures: 1, Errors: 0, Skipped: 0

That could well be my fault again - sorry about that!

I've been trying to improve and rationalise the functional tests; I
think I introduced a few timing issues which I've now resolved I
think. To help test more reliably I've introduced a MockEndpoint that
makes it easy to add expectations in a jMock kind of way, then assert
them after a test has completed...

http://cwiki.apache.org/CAMEL/mock.html

I've tried a build on OS X and Linux and it appears to work - could
you try doing a 'svn up' and seeing if its fixed now please?

-- 
James
-------
http://macstrac.blogspot.com/

Re: [camel] Content Based Router

Posted by "dr.jeff" <jl...@systechnologies.com>.
I checked out camel-core this morning (California time) and this problem
appears to be fixed.
However, please note that the build is now failing because of:
Results :

Failed tests:
  testSendMatchingMessage(org.apache.camel.processor.FilterTest)

Tests run: 43, Failures: 1, Errors: 0, Skipped: 0


James.Strachan wrote:
> 
> On 4/18/07, dr.jeff <jl...@systechnologies.com> wrote:
>>
>> The example as stated does not work:
>>     public void configure() {
>>         from("queue:a").choice()
>>                 .when(header("foo").isEqualTo("bar")).to("queue:b")
>>                 .when(header("foo").isEqualTo("cheese")).to("queue:c")
>>                 .otherwise().to("queue:d");
>>     }
>>
>> The result is an IllegalStateException from the SendProcessor. It appears
>> to
>> not have been started during context.start().
> 
> This was my bad, I'd broken a few things after a lifecycle related
> refactor of the code - bad James! Basically ChoiceProcessor wasn't
> invoking the lifecycle hooks of its child nodes.
> 
> I've added an explicit ChoiceTest to subversion which explicitly tests
> this route does work correctly. (I found another bug along the way in
> ChoiceProcessor not actually invoking the predicates correctly :).
> 
> If you grab the latest svn code it should be working fine now (and
> tomorrows nightly distro will be working too).
> 
> In the componets, like camel-jms, we test routing through the
> component; but I'm trying to add a complete test suite of routing
> rules to camel-core which were missing until recently. We've now got a
> test case for Choice and IdempotentConsumer along with basic rounting
> of the Queue component. We should aim for > 90% code coverage of
> camel-core to check the other processors are totally working too.
> 
> Thanks for spotting this!
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/-camel--Content-Based-Router-tf3603123s2354.html#a10080141
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: [camel] Content Based Router

Posted by James Strachan <ja...@gmail.com>.
On 4/18/07, dr.jeff <jl...@systechnologies.com> wrote:
>
> The example as stated does not work:
>     public void configure() {
>         from("queue:a").choice()
>                 .when(header("foo").isEqualTo("bar")).to("queue:b")
>                 .when(header("foo").isEqualTo("cheese")).to("queue:c")
>                 .otherwise().to("queue:d");
>     }
>
> The result is an IllegalStateException from the SendProcessor. It appears to
> not have been started during context.start().

This was my bad, I'd broken a few things after a lifecycle related
refactor of the code - bad James! Basically ChoiceProcessor wasn't
invoking the lifecycle hooks of its child nodes.

I've added an explicit ChoiceTest to subversion which explicitly tests
this route does work correctly. (I found another bug along the way in
ChoiceProcessor not actually invoking the predicates correctly :).

If you grab the latest svn code it should be working fine now (and
tomorrows nightly distro will be working too).

In the componets, like camel-jms, we test routing through the
component; but I'm trying to add a complete test suite of routing
rules to camel-core which were missing until recently. We've now got a
test case for Choice and IdempotentConsumer along with basic rounting
of the Queue component. We should aim for > 90% code coverage of
camel-core to check the other processors are totally working too.

Thanks for spotting this!


-- 

James
-------
http://radio.weblogs.com/0112098/