Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

In your Spring XML just use the CamelProxyFactoryBean to create a client side proxy implementing some interface which then sends messages to some remote Camel Endpoint such as ActiveMQ, JMS, File, HTTP, XMPP etc.

Then to implement the service you use CamelServiceExporter

The following example shows how to create a proxy which when invoked with fire a message to the direct:say endpoint

Wiki Markup
{snippet:id=proxy|lang=xml|url=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/remoting/spring-with-exporter.xml}

...

Wiki Markup
{snippet:id=export|lang=xml|url=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/remoting/spring-with-exporter.xml}

Using Custom Namespaces

In this example we use the Camel custom namespaces to make the XML much more concise. First, create a proxy via the proxy element

Wiki Markup
{snippet:id=proxy|lang=xml|url=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/remoting/spring-with-exporter-namespace.xml}

...

Wiki Markup
{snippet:id=export|lang=xml|url=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/remoting/spring-with-exporter-namespace.xml}

...

Note that the service is not mandatory; since the Bean component and the various other forms of Bean Integration can be used to route any message exchange to a bean, so you can miss out the serviceExporter if you prefer. The main value of the service exporter is its a single XML element to bind a URI to a bean and it allows the full API of the bean to be restricted by a serviceInterface.

Working with InOnly method calls

As of 1.5 Camel supports the @InOnly and @Pattern annotations to let you specify which methods are not InOut (Request Reply) but are InOnly (oneway or fire and forget Event Message).

For more details see Using Exchange Pattern Annotations

Include Page
CAMEL:Bean BindingCAMEL:
Bean Binding