-
1. Re: Drools and Camel
ffang Jun 7, 2012 8:09 AM (in response to wbailey)Hi,
In this case you need use camel-jbi component to route message in camel router to jbi endpoint, take a look at to get more details
http://camel.apache.org/jbi.html
Freeman
-
2. Re: Drools and Camel
wbailey Jun 7, 2012 8:44 AM (in response to ffang)Thanks for that, it's very helpful. The thing I'm confused about is that I don't have a jbi endpoint, I have a drools endpoint. Therefore do I need to wrap up the drools endpoint as a JBI endpoint using a from tag?
e.g
-
3. Re: Drools and Camel
ffang Jun 7, 2012 8:50 AM (in response to wbailey)Hi,
should be fine.
Freeman
-
4. Re: Drools and Camel
wbailey Jun 7, 2012 9:05 AM (in response to ffang)I've actually tried that but it resulted in the following exception:
13:51:16,406 | ERROR | l Console Thread | BlueprintContainerImpl | 9 - org.apache.aries.blueprint - 0.3.1.fuse-7-061 | Unable to start blueprint container for bundle fi-route-camel org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean blueprintContext at [19:org.apache.karaf.shell.console:2.2.5.fuse-7-061] ... at java.lang.Thread.run(Thread.java:619)[:1.6.0_19] Caused by: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[endpoint:droolsTestService]. Reason: java.lang.NullPointerException at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:381) ... org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:638)[9:org.apache.aries.blueprint:0.3.1.fuse-7-061] ... 33 more Caused by: java.lang.NullPointerException at org.apache.servicemix.camel.JbiEndpoint$JbiProducer.start(JbiEndpoint.java:95) at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:379) ... 104 more
-
5. Re: Drools and Camel
ffang Jun 7, 2012 8:59 PM (in response to wbailey)Hi,
Per ,the JBI endpoint URI format should be one of
jbi:service:serviceNamespace[sep]serviceName[?options]
jbi:endpoint:serviceNamespace[sep]serviceName[sep]endpointName[?options]
jbi:name:endpointName[?options]
ensure your configuration follow it.
http://camel.apache.org/jbi.html
Freeman
-
6. Re: Drools and Camel
wbailey Jun 8, 2012 12:03 PM (in response to ffang)I got this working but I had to invoke the drools endpoint via http using a http jbi service unit.
To do this I created a drools endpoint in its own su:
This means I can use the service mix drools engine, but I'm a little disappointed having to introduce another http hop. There must be a way to do this without using the jbi http su?
Ideally I want to invoke the jbi endpoint directly from the camel context but everything I try doesn't work. Any help would be much appreciated.
-
7. Re: Drools and Camel
davsclaus Jun 9, 2012 6:00 AM (in response to wbailey)What version of Drools are you using?
The Drools project has native Camel integration, so you ought to be able to leverage that without using JBI at all.
-
8. Re: Drools and Camel
ffang Jun 10, 2012 8:42 PM (in response to davsclaus)Hi,
Yeah, if you start a new project, you should use camel component instead but not the JBI component.
Btw, I don't think you really need introduce another http hop if you use JBI,try the route like
as I mentioned before
Per ,the JBI endpoint URI format should be one of
jbi:service:serviceNamespacesepserviceName?options
jbi:endpoint:serviceNamespacesepserviceNamesependpointName?options
jbi:name:endpointName?options
Here I just use the third format.
http://camel.apache.org/jbi.html
Freeman
-
9. Re: Drools and Camel
afilipchik Jun 21, 2012 1:19 AM (in response to ffang)Just my 2 cents - are you sure Drools is OSGi compatible?
I spent some time trying make drools-camel and drools-spring fully OSGi compatible but didn't find enough time to create required for submission unit tests
You can find patches at https://github.com/afilipchik
Maybe it is obsolete because of FAB, or maybe Jboss folks already pushed fix... Not sure there.