camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <>
Subject Re: Any interest in a Drools-based dynamic router?
Date Sat, 20 Nov 2010 23:13:37 GMT

Can you please post a unit test/example that doesn't necessarily work, but shows what you
intend to do?

When the camel-drools component was initially developed there was a discussion about where
it should be developed. Since both projects as AL2 licensed, it didn't make much of a difference
and the drools community preferred to host it there based on the assumption that it will be
better maintained. I don't think there should be another camel-drools component hosted at
the ASF, instead we should improve the existing one. The drools community is, in my experience
very open to that.

You can create a jira with apache camel (and assign it to me) if you prefer and I can follow
up and get it integrated in the drools code base.


On Nov 17, 2010, at 4:15 AM, deckerego wrote:

> Just to clarify, here's an ideal route scenario:
> &lt;route>
>    &lt;from uri="broker:queue:router"/>
>    &lt;dynamicRouter>
>        &lt;policy ref="droolsPolicy">
>            &lt;to uri="drools:node1/ksession1"/>
>        &lt;/policy>
>    &lt;/dynamicRouter>
> &lt;/route>
> This would in turn execute a DRL like (using a paraphrased rule): 
> rule "fetchUser"
>    dialect "mvel"
>    when
>        m : Exchange( in.body instanceof FetchUser )
>    then
>        insert( new Route("broker:queue:fetchUser") );
> end
> The current Drools component and Spring integration does a great job of
> bootstrapping a node, but then I would also need to perform transformations
> from [ Camel Exchange -> Inserting Facts ] and [ Execution Results -> Camel
> Routes ]. Those aren't impossible tasks by any stretch of the imagination...
> I think a Camel TypeConverter could possibly do part of the job.
> DroolsProducer is coded correctly since it performs a
> getBody(Command.class), so type conversion from an Exchange to a Command
> would be doable. However, dynamic routers are required to return URI
> String's and that would likely require manual conversion.
> deckerego wrote:
>> I've built a prototype based on the drools-server example and thought I'd
>> post my results here. No questions at this point per se, but I thought I'd
>> at least send out an update for those interested.
>> It looks the Drools Camel component produced by JBoss isn't particularly
>> well suited for routing, although it does simplify configuration a bit.
>> Ultimately things boil down to:
>> Command batchCommand = CommandFactory.newBatchExecution(commands,
>> "ksession1");
>> ExecutionResults results = template.requestBody("direct:rules",
>> batchCommand, ExecutionResultImpl.class);
> -- 
> View this message in context:
> Sent from the Camel Development mailing list archive at

View raw message