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

The normal routing mechanism in JBI uses Queue Semantics, that is each request is routed to one and only one endpoint. In addition we also provide for Publish and Subscribe Routing which allows JBI components to

ServiceMix supports an additional routing mechanism which uses Topic Semantics. That is every subscriber who is interested in the message receives a copy of the message.

You can subscribe to the output of another JBI component, using Topic semantic - every applicable subscriber receives a copy of the message in addition to the more usual Queue semantics of routing defined by the JBI specification.an endpoint as follows, using the <subscriptionSpec service="serviceQName"/> tag. (You can include as many as you like inside a <subscriptions/> tag

Wiki Markup
{snippet:id=subscribe|lang=xml|url=servicemix/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/jms/example-endpoint-subscription.xml}

Notes

Note that the queue semantics and topic semantics are completely mutually exclusive. A single endpoint can have a collection of destination endpoints used to dispatch messages as well as a group of subscribers.

A message is dispatched to its usual JBI destination endpoint, then whether its dispatched or not, its also dispatched to all of its subscribers.

To avoid confusing JBI users, it is an error for a message to not be deliverable using the normal JBI sematics. If you wish to allow no message to be dispatched in the normal JBI manner and want to use just subscriber based routing you can disable the JBI error by setting the failIfNoDestinationEndpoint flag on each <activationSpec/>.

Wiki Markup
{snippet:id=publish|lang=xml|url=servicemix/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/jms/example-endpoint-subscription.xml}