Just to clarify, here's an ideal route scenario:
<route>
<from uri="broker:queue:router"/>
<dynamicRouter>
<policy ref="droolsPolicy">
<to uri="drools:node1/ksession1"/>
</policy>
</dynamicRouter>
</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:
http://camel.465427.n5.nabble.com/Any-interest-in-a-Drools-based-dynamic-router-tp3265110p3268523.html
Sent from the Camel Development mailing list archive at Nabble.com.