Versions Compared

Key

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

servicemix-eip

Info

The servicemix-eip component is deprecated. Please use servicemix-camel which provides Apache Camel to implement all available Enterprise Integration Patterns.

The servicemix-eip component is a routing container where different routing patterns can be deployed as service unit.

This component is based on the great Enterprise Integration Patterns book.

Info
titleApache Camel

Note that Apache Camel provides a full set of Enterprise Integration Patterns both from Java code or Spring XML which you may want to consider as an alternative to ServiceMix EIP.

For more details see the servicemix-camel component, the comparison of ServiceMix EIP and Camel and how Camel works with JBI endpoints.

Supported patterns:

Supported patterns:

In addition, this component can use all ServiceMix flows (including clustered and transactional flows), can be configured to be resilient to crashes and supports full fail-over to another node when clustered.

Using servicemix-eip as a standard JBI component

Installation

Installing the servicemix-eip component can be done in several ways:

  • drop the installer zip in an hotdeploy directory monitored by ServiceMix
  • using ant tasks

Note that when using ant tasks, the component is not started, you will have to start it manually using ant tasks or a console.

Configuration

For a complete list of configuration options for the supported EIPs, take a look at the XSD and generated HTML for this component on the Xml schemas page.
TODO: configure a persistent / clustered store

Service Unit packaging

Content of xbean.xml file to be packaged as a SU

...


<beans xmlns:eip="http://servicemix.apache.org/eip/1.0">

  ... add eip patterns here ...

</beans>

Using servicemix-eip in a ServiceMix xml configuration file

...


<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
       xmlns:eip="http://servicemix.apache.org/eip/1.0">

  <sm:container ...>
    <sm:activationSpecs>
      <sm:activationSpec>
        <sm:component>
          <eip:component>
            <eip:endpoints>

              ... add eip patterns here ...

            </eip:endpoints>
          </eip:component>
        </sm:component>
      </sm:activationSpec>
      ...
    </sm:activationSpecs>
  </sm:container>
  ...

</beans>

.

Maven Archetype

You can create a EIP Service Unit using the servicemix-eip-service-unit archetype:

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.servicemix.tooling \
  -DarchetypeArtifactId=servicemix-eip-service-unit \
  -DarchetypeVersion=2010.01 \
  -DgroupId=your.group.id \
  -DartifactId=your.artifact.id \
  -Dversion=your-version

Endpoint Configuration

The EIP configuration is defined directly in the xbean.xml:

Code Block

<bean xmlns:eip="http://servicemix.apache.org/eip/1.0">
  ... add EIP patterns here ...
</bean>

For example:

Code Block

<bean xmlns:eip="http://servicemix.apache.org/eip/1.0"
      xmlns:replaceMe="http://servicemix.apache.org/replaceMe">
  <eip:static-recipient-list service="replaceMe:serviceName" endpoint="static-recipient-list">
    <eip:recipients>
      <eip:exchange-target service="replaceMe:serviceName" endpoint="targetEndpoint" />
      <eip:exchange-target service="replaceMe:serviceName" endpint="otherEndpoint" />
    </eip:recipients>
  </eip:static>
</bean>

Supported EIP Patterns

Content-Based router

ContentBasedRouter can be used for all kind of content-based routing.
This pattern implements the Content-Based Router pattern.

...