This getting started guide shows how to install Jbi4Corba and a sample service assembly in ServiceMix. This component has been tested with servicemix-3.1.1-incubating.
A binding component using Jbi4Corba exposes on the internal BUS an external service provided by a CORBA servant. To locate the servant, the Jbi4Corba component must use a CORBA name server (or other localization mechanism).
Thus the integration scenario is shown in the following figure:
Jbi4Corba needs the jdk's tools.jar. You can put this jar file in the <SERVICEMIX_HOME>/lib/optional.
To run jbi4corba it's necessary both a shared library and the component. The shared library contains jacorb's orb and it's named jacorb-library.zip. Download Jbi4Corba and copy them into <SERVICEMIX_HOME>/install.
A service assembly is a deployable item that configure one or more endpoint inside a JBI ESB. We are going set up a configuration that take a Corba service and expose it a SOAP/HTTP Webservice. The configuration is shown in the following figure:
The Jbi4Corba component is used to create an internal (i.e. visible inside the ESB) endpoint. This internal endpoint is then used to create an external endpoint with the servicemix-http Binding Component. The http component will proxy the incoming externall calls to the internal endpoint exploiting the JBI routing mechanisms.
A Service Assembly (SA) is a zip file containing one or more Service Unit (SU) file, each Service Unit defining one or more endpoint. We need two Service Unit (SU):
A Jbi4Corba service unit has the following layout:
+- <WSDL_NAME>.wsdl +- META-INF/ +- jbi.xml
where:
Zip all the files in the specified layout and name the archive JBI4CorbaSU.zip.
A http service unit has the following layout:
+- xbean.xml +- META-INF/ +- jbi.xml
where:
the xbean.xml has the following format:
<?xml version="1.0"?> <beans xmlns:http="http://servicemix.apache.org/http/1.0" xmlns:corba_urn="<SERVICE_NAMESPACE>"> <http:endpoint service="corba_urn:<SERVICE_NAME>" endpoint="<SERVICE_NAME>CorbaPort" interfaceName="corba_urn:<SERVICE_NAME>" role="consumer" locationURI="http://localhost:8192/Service/<SERVICE_NAME>" defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" /> </beans>
where:
Zip all the files in the specified layout and name the archive HttpSU.zip (the archive name is not important)
The service assembly is unit of deployable configuration in JBI, in our example it has the following layout:
+- JBI4CorbaSU.zip +- HttpSU.zip +- META-INF/ +- jbi.xml
where:
The jbi.xml has the following format as described in the JBI Specification:
<?xml version="1.0" encoding="UTF-8"?> <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <service-assembly> <identification> <name><SA_NAME></name> <description><SA_DESCRIPTION></description> </identification> <service-unit> <identification> <name><SU1_NAME></name> <description><SU1_DESCRIPTION></description> </identification> <target> <artifacts-zip>JBI4CorbaSU.zip</artifacts-zip> <component-name>jbi4corba</component-name> </target> </service-unit> <service-unit> <identification> <name><SU2_NAME></name> <description><SU2_DESCRIPTION></description> </identification> <target> <artifacts-zip>HttpSU.zip</artifacts-zip> <component-name>servicemix-http</component-name> </target> </service-unit> </service-assembly> </jbi>
where:
Notice that the BC filenames (JBI4CorbaSU.zip and HttpSU.zip) are specified with the respective component (jbi4corba and servicemix-http). Zip all the files in the specified layout and name the archive HttpToCorbaSA.zip (the archive name is not important).
ServiceMix provides a maven2 plugin to automate the process of creation and deploy of JBI artifacts.
Copy the created service assembly in <SERVICEMIX_HOME>/deploy.