Comments? Questions? Get Involved? Join the Forum
Apache Camel (http://camel.apache.org) is a tool for routing and processing messages with tools for Enterprise Integration Patterns which are described here (and other pages on this site have much other good information about EIP): http://www.eaipatterns.com/toc.html
Moqui Framework has a Message Endpoint for Camel (MoquiServiceEndpoint) that ties it to the Service Facade. This allows services (with type=camel) to send the service call as a message to Camel using the MoquiServiceConsumer. The endpoint also includes a message producer (MoquiServiceProducer) that is available in Camel routing strings as moquiservice.
Here are some example Camel services from the ExampleServices.xml file:
<service verb="localCamelExample" type="camel"
location="moquiservice:org.moqui.example.ExampleServices.targetCamelExample">
<in-parameters><parameter name="testInput"/></in-parameters>
<out-parameters><parameter name="testOutput"/></out-parameters>
</service>
<service verb="targetCamelExample">
<in-parameters><parameter name="testInput"/></in-parameters>
<out-parameters><parameter name="testOutput"/></out-parameters>
<actions>
<set field="testOutput" value="Here's the input: ${testInput}"/>
<log level="warn"
message="targetCamelExample testOutput: ${result.testOutput}"/>
</actions>
</service>
When you call the localCamelExample service it calls the targetCamelExample service through Apache Camel. This is a very simple example of using services with Camel. To get an idea of the many things you can do with Camel the components reference is a good place to start:
http://camel.apache.org/components.html
The general idea is you can:
Camel is a very flexible and feature rich tool so instead of trying to document and demonstrate more here I recommend these books:
Instant Apache Camel Message Routing by Bilgin Ibryam
Apache Camel Developer's Cookbook by Scott Cranton and Jakub Korab
Camel in Action by Claus Ibsen and Jonathan Anstey