Versions Compared

Key

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

...

First some background. A JBI component is either a service engine (SE) or a binding component (BC). These terms are defined in Introduction to ESB and/or the Glossary. A BC/SE is installed on ServiceMix by copying it into the install directory which resides under the ServiceMix home directory. So what gets deployed? JBI components can act as containers themselves. Artifacts can be deployed to an existing BC or SE to add more functionality to that component. Adding artifacts to installed components is called deployment. To deploy artifacts to a component the artifacts can be placed in the deploy directory under the ServiceMix home directory. Another term that is important to know is service assembly. A service assembly is a collection of deployment artifacts and metadata. A service unit is a single deployment artifact which is deployed on a single component. For deployment to happen, the artifacts must be in a very specific format, which is specified in the JSR 208 specification. Please see chapter 6 of the JSR 208 specification for more details. In addition to deploying components, ServiceMix allows servicemix.xml files to be deployed in a similar method to deploying a component. ]

...

Manually Creating the Service Unit and Service Assembly for the ServiceMix Loan Broker Example

We are going to use the existing ServiceMix Loan Broker example, which can be found Loan Broker Demo for ServiceMix, as the basis for this discussion.

There are several things to note about this example. First of all it is meant to be run stand-alone. Specifically, when running this example, ServiceMix will be started for you, then the loan broker is
deployed and run. Therefore, there is a servicemix.xml file in the loan-broker directory. This
servicemix.xml file is used for configuring the ServiceMix JBI container upon ServiceMix starting up. This is not to be confused with the servicemix.xml located in the loan-broker\src\su directory. The SU servicemix.xml file is used to configure the servicemix-lwcontainer. Every service unit must contain some kind of configuration file. For example, if we were creating a service unit for the BPEL service engine there would also be a configuration file, but it would not be a servicemix.xml file, such as the one used for configuring the lightweight container.

...

Now we are ready to assemble the components together. The loan broker demo supplies us with the a build.xml file (which was used in the compile step above). The build.xml contains targets for creating service units and service assemblies. If you run "ant setup" the a service unit and service assembly will automatically be created. Ultimately, this is what you will want to do, however, the following procedure gives the manual steps for creating a service unit and service assembly, to facilitate in understanding the contents of a SUs and SAs.

...