Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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}

Then we expose the service on an endpoint so that messages from direct:sayImpl will be dispatched to the service (note that we have a route in between these two endpoints).

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 the proxy factory

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}

Then we expose the service via a serviceExporter

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}

Its much cleaner - use whichever approach you prefer as they are both equivalent.

ServiceExporter is Optional

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.

Include Page
CAMEL:Bean Binding
CAMEL:Bean Binding