Service Activator

Camel supports the Service Activator from the EIP patterns book.

How can an application design a service to be invoked both via various messaging technologies and via non-messaging techniques?

image

Design a Service Activator that connects the messages on the channel to the service being accessed.

Camel has several endpoint components that support the Service Activator from the EIP patterns.

Components like Bean and CXF provide a a way to bind the message exchange to a Java interface/service where the route defines the endpoints and wires it up to the bean.

In addition you can use the Bean Integration to wire messages to a bean using annotation, or even hide all the middleware behind a plain Java interface.

Sample

Here is a simple example of using a Direct endpoint to create a messaging interface to a POJO Bean service.

Using Java DSL

from("direct:invokeMyService")
  .to("bean:myService");

Using the XML DSL

<route>
  <from uri="direct:invokeMyService"/>
  <to uri="bean:myService"/>
</route>