You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

ServiceMix allows for different message dispatch policies within the Normalized Message Router (NMR) Broker.
There are four basic types, that have different characteristics and are suited to different usage cases.

They are as follows:

ST Flow

Straight-through flow. A MessageExchange is routed straight to it's destination with no staging or buffering. A straight through flow is best suited for the cases where the ServiceMix JBIContainer is deployed with simple flows (no state) or embedded, or where latency needs to be as low as possible.

ST Flow

Seda Flow

The SedaFlow introduces a simple event staging between the internal processes in the NMR Broker. A Seda flow (the default) is suited for general deployment, as the additional staging is well suited buffering exchanges between heavily routed to components (where state may be being used) for example.

Seda Flow

JMS Flow

A JMS Flow is used for cases where you need collaboration between more than one ServiceMix JBIContainer (for fail-over or scalability).
Component deployment happens in the same way as a normal SericeMix JBI container (both for POJO and archive Component deployment) but all the containers in the cluster are notified of a deployment, and the JMS Flow will handle automatic routing (and failover) of MessageExchange(s) between the container instances.
A Message Queue is used for each JBI endpoint, so multiple instances of the same named Component will have requests load balanced across them.

JMS Flow

JCA Flow

The JCA Flow is very similar to the JMS Flow, in that it allow to cluster ServiceMix containers together.
The main difference is that it uses JCA to provide support for XA transactions when sending and receiving
JBI exchanges. You can find more informations on transactions here.

Configuring flows

Flows are configured on the JBI container by usually using the flowNames attribute on the main container element.

<sm:container flowNames="seda">
  ...
</sm:container>

JMS and JCA flows should be configured with an ActiveMQ url to the broker.

<sm:container flowNames="jms?jmsURL=tcp://localhost:61616">
  ...
</sm:container>

You can defined several flows by using a comma separated list.

<sm:container flowNames="seda,jms?jmsURL=tcp://localhost:61616">
  ...
</sm:container>

For more complex configurations, you can define the flow explicitely.

<sm:container>
  <sm:flows>
    <sm:sedaFlow />
    <sm:jcaFlow bootstrapContext="#bootstrapContext"
                connectionManager="#connectionManager"
                jmsURL="vm://localhost" />
  </sm:flows>
</sm:container>
  • No labels