Table
of Contents | Previous | Next
Work order management is a key driver for mobile solutions and is an important
part of automating the delivery process for
JKCourier, as well as
improving efficiency and customer service. The micro broker provides a
way to bridge from the client application to the enterprise work order
management systems. Enterprise integration is typically enabled through
software such as WebSphere Enterprise Service Bus (WESB) or WebSphere Process
Server (WPS). In addition to providing integration with the back-end work
order management system, WebSphere Process Server can also enable process
driven workflow. Since WebSphere Process Server is based on the Service
Integration (SI) Bus of WebSphere Application Server (WAS), bi-directional
messaging with the WebSphere Process Server can be implemented using a
micro broker bridge connection to the SI Bus of WAS. Connecting the micro
broker to WESB or WPS is not possible using the micro broker bridge with
MQtt connection; to connect to the SI Bus of WAS, the micro broker bridge
must be configured with the JNDIConnectionDefinition object. The JNDIConnectionDefinition
provides connectivity to a JMS provider using JNDI administered objects.
The SI Bus client software is required by the Microbroker bridge to make
a connection to the SI Bus. As the SI Bus client software requires a full
J2SE VM, it is not possible for this type of connection to be made with
the micro broker bridge on a device. Instead, a JMS MQtt client on the
device can be configured to connect to a remote micro broker with bridge
configured. The remote micro broker can run in a custom Expeditor platform
configured with the J2SE VM, in headless mode.
Prerequisites
The micro broker bridge requires the IBM client for JMS on J2SE with IBM
WebSphere Application server for connecting to the SI Bus of WAS. The micro
broker bridge is like a normal JMS client from a WAS perspective. Hence
it is necessary to download the “IBM Client for JMS on J2SE with IBM WebSphere
Application Server” from
http://www-1.ibm.com/support/docview.wss?uid=swg24012804
. Upon installing we’ll get two jar files sibc.jms.jar and sibc.jndi.jar
which will have all the required class files at the client end.
The WebSphere application server needs to be installed and running.
Configuring the WAS SI Bus and JNDI resources
Instructions for installing and getting started with using WAS are available
in the WAS infocenter:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp.
Assuming that we have installed and created a profile, let’s start by
looking at that configuration.
1. Open the administrative console. If WAS is installed on the local system
with default port values then the administrative console address would
be:
http://localhost:9060/ibm/console/
where 9060 is the port number. Login to the administrative console. This
could change based on the security settings that have been applied.
2. Go to Service Integration Buses. There may some already existing
buses. You can either re-use them or create a new Bus. To create a new
bus, click “New” and then in the configuration tab enter a name for the
bus, say “DWBUS”. Leave the other settings as default and click “OK”
at the bottom of the page. The newly created Bus will be listed in “Buses”
page.
<>
3. Now we need to create the bus members. Go to DWBUS Bus Members.
Click “Add” and choose the appropriate Server name from the drop down
list. Click Next and then Finish.
4. Now we need to create the destinations. Go to Service Integration Buses
DWBUS Destinations. Click “New” and select the destination
type as “Queue”. Ente r the name of the Queue, say “WASINQ”. This is
where the messages coming from the micro broker will be placed. Click “Next”
and then “Finish”.
5. Repeat the Step (4) and create a sync queue, say “SYNCQ”. There is
no default sync queue and this needs to be created.
6. Click “Save” on the Messages pane to save the changes made.
<>
The configuration of the Service Integration Bus is now completed. Now
let’s see the steps to create the JMS resources.
1. Go to Resources JMS Providers Default Messaging JMS
connection factory New and create a new Queue Connection Factories
with the following properties:
Name: qcf
JNDI Name: jms/qcf
Bus Name: DWBUS
Target inbound transport chain: InboundBasicMesssaging
Provider endpoints: myhostname:7276:BootstrapBasicMessaging
(Using localhost for the host name is not preferred if WAS is running on
local system. IP address or the machine name has to be used)
2. Go to Resources JMS Providers Default Messaging JMS
queue. Click on “New” to associate a JMS Queue to the actual Queue in
the SI Bus with the following properties:
Name: WASINQ
JNDI Name: JMS/WASINQ
Queue Name: WASINQ
Bus Name: DWBUS
Similarly associate a JMS Queue to the sync queue in the SI Bus with the
following properties:
Name: SYNCQ
JNDI Name: JMS/SYNCQ
Queue Name: SYNCQ
Bus Name: DWBUS
3. Click “Save” on the Messages pane to save the changes made.
Restart the WAS server now and check if all the objects created above and
present.
Configuring the micro broker to connect to WAS
We need to find create a JNDIJMSConnectionDefinition. The initial context
that needs to be used is WsnInitialContextFactory. More details are available
in the web page: (
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/naming/WsnInitialContextFactory.html).
We’ll use Internet Inter-ORB Protocol in the URL.
JNDIConnectionDefinition cd = bridge.createJNDIConnectionDefinition("jndijms_was");
cd.setInitialContext("com.ibm.websphere.naming.WsnInitialContextFactory");
cd.setURL("iiop://localhost:9100");
cd.setConnectionFactoryKey("jms/qcf");
cd.setSyncQKey("JMS/SYNCQ");
Import the two jar files sibc.jms.jar and sibc.jndi.jar into the project
and add them to the Build Path of the Client Services Project.
Open Manifest.mf and edit/add the Bundle-Classpath and Export-Package
to:
Bundle-ClassPath: sibc.jms.jar,
sibc.jndi.jar,
.
Export-Package: com.ibm.websphere.naming
Running the Bundle:
This bundle needs to be deployed on the IBM Lotus Expeditor Device Runtime
Environment (C761LML)
http://www-1.ibm.com/support/docview.wss?uid=swg24014055.
It provides a J2SE environment for the bundles.
1. Once installed run the launcher “C:\Program Files\IBM\Lotus\ExpeditorDRE\rcp\
launch_dre.bat”
2. Install the micro broker bundles on the device runtime. The micro broker
bundles will be available in Toolkit/Client installation or the Expeditor
Client runtime installation. Install using the commands (example):
install "file:C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.micro.bridge.jndi.jms_2.
0.0.0-20061101.jar"
install "file:/C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.micro.bridge.mq.jms_2.0.0.0-20061101.jar"
install "file:C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.micro.utils_2.0.0.0-20061101.jar"
install "file:/C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.micro_2.0.0.0-20061101.jar"
install "file:C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.mqttclient.jms_2.0.0.0-20061101.jar"
install "file:/C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.mqttclient_2.0.0.0-20061101.jar"
install file:C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.pvc.jndi.provider.java_6.1.0.0-20061108.jar
Install the “IBM Client for JMS on J2SE with IBM WebSphere Application
Server” bundles on the runtime.
install "file:/C:\microbroker\IBM Client for WAS\lib\sibc.jms.jar"
install "file:C:\microbroker\IBM Client for WAS\lib\sibc.jndi.jar"
Install the JMS bundle also on the runtime for resolving the javax.jms
install "file :/C:\microbroker\eclipseXPD\eclipse\plugins\com.ibm.pvc.wct.runtimes_6.1.0.0-20061108\rcp\eclipse\plugins\com.ibm.pvc.jms_1.1.0.20061108"
Install the bundle that is developed using the above JMS JNDI connection
definition (Also available in the examples below)
Install “file:C:\microbroker\eclipseXPD\Article Workspace\JMS_WASBridge”
Once installed start all the bundles using the command:
Start
Send the messages using MQTT Client developed above to micro broker. The
messages will reach WAS. To view the message in WAS open the administrative
console and browse to : Service Integration Buses DWBUS Destinations
WASINQ Queue Points
WASINQ@localhostNode01.server1-DWBUS
Runtime Messages
The above examples uses the WAS as a JNDI provider. It can also be configured
to use the expeditor's JNDI provider. The following code snippet helps
in binding the JMS objects on the expeditor's JNDI.
TODO: CODE HERE