Work order retrieval – retrieval of work orders using messaging
– WAS SI Bus (WPS) connectivity – headless micro broker on desktop. Connecting
a device to WESB/WPS is not possible using the Micro broker bridge with
MQtt connection; to connect to the SI Bus of WAS, the 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
this connection. 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 Microbroker can run in a custom Expeditor platform configured
for headless mode.
<>
<>
Bridging to Websphere Application Server(WAS)
As the foundation of the IBM® WebSphere® software platform,
WebSphere Application Server V6.1 delivers the secure, scalable, resilient
application infrastructure you need for a Service Oriented Architecture
(SOA). Refer to
http://www-306.ibm.com/software/webservers/appserv/was/
for more details. WAS provides a service integration bus that supports
applications using message-based and service-oriented architectures. WebSphere
Enterprise Service Bus (WebSphere ESB) is also built on top of WAS.
For connecting to WAS, we use the JNDI based JMS connection.
At the client end we’ll need some JNDI and JMS classes shipped along with
WAS. 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. Now let’s
explore how we can configure the WAS and micro broker resources.
Configuring 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 looking
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