Versions Compared

Key

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

...

  • All components registered via Spring use the same class loader; this may or may not be an issue for you
  • The Spring configuration is ServiceMix specific and not portable to other JBI containers (unless they support a similar mechanism as ServiceMix).

...

  • , though you should be able to embed ServiceMix into any JBI container as a component.

Configuring using Spring XML

So lets see how to wire together a couple of components with Spring. The easiest way to get started is to see an example. The following configuration is taken from these examples.

Wiki Markup
{snippet:id=example|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/components/pojo/example.xml?rev=HEAD}

We introduce a few new XML tags for JBI configuration, but apart from that you can use all of the regular Spring . You need to do the following...configuration tags - bean, property, value etc. This allows you to mix and match regular Spring configuration of POJOs with our JBI Spring configuration mechanism.

Routing services together.

As you can see in the above example we use destinationService or destinationInterface or destinationOpertion on a <component> to denote its routing. A component can decide if it wishes how to route requests to another service. If the component just routes to the default output service then these destination settings are used by ServiceMix to route the request.

Using pure Spring

If you don't wish to use the Spring extension XML as shown above you can configure ServiceMix and its components using regular Spring XML. Here's how

  • Configure an instance of the SpringJBIContainer as a regular Spring POJO.
  • Configure the components you wish to deploy as regular Spring POJOs
  • List the components you want to deploy in the componentNames property of the JBI container.

...