activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [camel] Content Based Router
Date Wed, 18 Apr 2007 23:23:05 GMT
On 4/18/07, dr.jeff <jlansing@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/

Mime
View raw message