...
To create a configuration, a JBI SU, you can will use the Maven archetypes that are provided with ServiceMix. Maven archetypes are used to create a Maven project skeleton to jumpstart project creation via the automation of repetitive tasks by following standard conventions. The result of using a Maven archetype to create a Maven project is a directory structure, a Maven POM file (pom.xml
) and, depending on the archetype being used, sometimes Java objects and JUnit tests.
...
In the diagram above, notice where requests are initiated and the direction of the arrows to denote the flow from the initiator. For the example, we'll be creating a consumer to expose a service already running in the JBI container via HTTP.
Creating a SU Maven Project
For this example, let's suppose that we're creating a consumer SU. A consumer SU contains a configuration that tells the servicemix-http component to expose an endpoint via HTTP for some service that is already running on deployed to the JBI Normalized Message Router (NMR)container. Below is the command to create the consumer SU Maven project for the servicemix-http component:
...
The command above utilizes the servicemix-http-consumer-service-unit Maven archetype to create a Maven project named my-consumer-su. This command creates a directory named my-consumer-su
that contains a Maven project skeleton meaning all the necessary files are in place, you simply need to enter the correct values for the configuration. Below is the directory structure created by this archetype:
...
The only requirement of a JBI SU is that it contain a JBI deployment descriptor located in META-INF/jbi.xml
. As mentioned above, the Maven archetypes for SUs create creates a pom.xml
file that includes configuration and use of the Maven JBI plugin. This is a plugin that automatically generates the META-INF/jbi.xml
file based on other information in the pom.xml
file. Below is the hierarchy of the contents of the SU archive that is created when running the Maven install goal as noted above:
...
Notice that this SU archive contains a META-INF/jbi.xml
file. This was created by the Maven JBI plugin. Below is the pom.xml
file for the project above:
Panelcode |
---|
$ cat ./target/my-consumer-su-1.0-SNAPSHOT-installer/META-INF/jbi.xml <?xml version="1.0" encoding="UTF-8"?> <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <services binding-component="false" xmlns:replaceMe="http://servicemix.apache.org/replaceMe"> <consumes service-name="replaceMe:withYourService" endpoint-name="soap"/> </services> </jbi> |
This file is a deployment descriptor for the JBI container when the SU is deployed.
...