Attached: http://camel.465427.n5.nabble.com/file/n3274023/drools_cbr.tar.bz2
drools_cbr.tar.bz2
Attached is a working version of what I'm thinking. I sent this to Mark
Proctor over at the Drools project on Thursday as well. The implementation
attached isn't ideal, but it ended up being the cleanest one I could
discern.
The type conversion is pretty straightforward; it was more of enforcing
convention rather than adding any functionality. The type converters, their
unit tests and Camel's META-INF registries are in the tarball.
When it came to actual routing, the dynamicRoute EIP was ill fitted for this
use case, but the recipientList pattern worked well. I resorted to using the
Bean Language to specify the recipientList pattern, although I don't quite
like the aesthetics of it. The Drools-based route ended up being defined as:
<route>
<from uri="cbrBroker:queue:router"/>
<recipientList>
<method ref="fetchRouter"/>
</recipientList>
</route>
...
<bean id="fetchRouter" class="org.drools.camel.cbr.router.FetchRouter">
<property name="droolsEndpoint" value="drools:node1/ksession1"/>
</bean>
It looks ugly to have the router construction outside of the route
definition itself... but I'm not sure how else to do it without endpoint
injection or creating a whole new route pattern.
Let me know what you think... I've been spinning the issue around in my head
for the past couple of days but haven't been able to think of a superior
solution.
Hadrian Zbarcea wrote:
>
> 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.
>
--
View this message in context:
http://camel.465427.n5.nabble.com/Any-interest-in-a-Drools-based-dynamic-router-tp3265110p3274023.html
Sent from the Camel Development mailing list archive at Nabble.com.