Chapter 8 Integrating With IBM WebSphere Application Server Version 5 : Get the Sample MDB running with TIBCO Enterprise Message Service

Get the Sample MDB running with TIBCO Enterprise Message Service
Create the TIBCO Enterprise Message Service Administered Objects
1.
2.
 
   > create factory sample.TCF topic
   > create factory sample.QCF queue
   > create topic sample.*
   > create jndiname sample.listen topic sample.*
   > create topic sample.weather
   > create topic sample.sport
   > create topic sample.news
   > create queue sample.Q1
   > create queue sample.Q2
Configure WebSphere for the TIBCO Enterprise Message Service JNDI Provider
1.
2.
 
java.naming.factory.url.pkgs=com.tibco.tibjms.naming
3.
This allows both the WebSphere application server and client container to find the TIBCO Enterprise Message Service URLConnectionFactory when it encounters the tibjmsnaming JNDI naming scheme.
Add TIBCO Enterprise Message Service as a JMS Provider to the Application Server
1.
2.
3.
Expand Resources and choose Generic JMS Providers.
4.
Click the New button.
5.
 
EMS_HOME\jar\tibjms.jar
tibjmsnaming://localhost:7222
6.
Click the OK button.
7.
Click the Save button on the task bar at the top of the console window.
8.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Resources > Messaging > Using JMS and messaging in applications > Administering JMS WebSphere support > Installing and configuring a JMS provider > Defining a generic JMS provider.
Configure JNDI Bindings for TIBCO Enterprise Message Service Connection Factories for the Application Server
1.
From the WebSphere Administrative Console, expand Resources and choose Generic JMS Providers.
2.
3.
Scroll down and choose JMS Connection Factories.
4.
Click the New button.
5.
 
6.
Click the OK button.
7.
Click the New button.
8.
 
9.
Click the OK button.
10.
Click the Save button on the task bar of the Administrative Console (and Save again to confirm),
11.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Resources > Messaging > Using JMS and messaging in applications > Administering JMS WebSphere support > Configuring JMS provider resources > Configuring resources for a generic JMS provider > Configuring a JMS connection factory, generic JMS provider.
Configure JNDI Bindings for TIBCO Enterprise Message Service Destinations for the Application Server
1.
From the WebSphere Administrative Console, expand Resources and choose Generic JMS Providers.
2.
3.
Scroll down and choose JMS Destinations.
4.
Click the New button.
5.
 
6.
Click the OK button.
7.
 
Sample News Topic
Sample Sport Topic
Sample Weather Topic
8.
Click the Save button on the task bar of the Administrative Console (and Save again to confirm).
9.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Resources > Messaging > Using JMS and messaging in applications > Administering JMS WebSphere support > Configuring JMS provider resources > Configuring resources for a generic JMS provider > Configuring a JMS destination, generic JMS provider.
Create new Listener Ports for TIBCO Enterprise Message Service
1.
From the WebSphere Administrative Console, expand Servers and choose Application Servers.
2.
3.
4.
5.
6.
 
7.
Click the OK button.
8.
 
9.
Click the Save button on the task bar of the Administrative Console (and Save again to confirm).
10.
11.
After the application server has restarted, use the WebSphere Administrative Console to verify that the new listener ports are in their proper initial state.
To do this, expand Servers > Application Servers, then choose your server name in the content pane, then on Message Listener Service and then on Listener Ports. The new TIBCO listener ports should have a solid green arrow under the status column indicating that they are started.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > EJB modules > Using message-driven beans in applications > Configuring message listener resources for message-driven beans > Adding a new listener port.
Reassemble the Sample MDBs to Use the New TIBCO Enterprise Message Service Listener Ports
1.
2.
Open the MDBSamples.ear file located in the <install_root>/AppServer/samples/lib/MessageDrivenBeans directory.
3.
In the navigation pane, expand MDBSamples > EJB Modules > PSSampleMDB.jar.
4.
Choose Message Driven Beans, then in the content pane, choose PSSampleMDB.
5.
Click the Bindings tab in the property pane.
6.
7.
Click the Apply button.
8.
In the navigation pane, expand MDBSamples > EJB Modules > PtoPSampleMDB.jar.
9.
Choose Message Driven Beans, then in the content pane, choose PtoPSampleMDB.
10.
Click the Bindings tab in the property pane.
11.
12.
Click the Apply button.
13.
Choose File > Save from the menu.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > EJB modules > Using message-driven beans in applications > Deploying an enterprise application to use message-driven beans > Configuring deployment attributes for a message-driven bean.
Redefine the Resource Reference and Resource Environment Reference for the Point-to-Point Sample MDB
1.
In the navigation pane of the WebSphere Application Assembly Tool, under MDBSamples, expand EJBModules > PtoPSampleMDB.jar > Message Driven Beans > PtoPSampleMDB.
2.
Choose Resource References. The name JMS/SamplePPQCF should appear in the content pane.
3.
Click the Bindings tab.
4.
Change the value of JNDI Name from Sample/JMS/QCF to tibjmsnaming://localhost/sample.QCF.
5.
Click the Apply button.
6.
In the navigation pane, choose Resource Environment References. The name JMS/SampleOutputQueue should appear in the content pane.
7.
Click the Bindings tab.
8.
Change the value of JNDI Name from Sample/JMS/Q2 to tibjmsnaming://localhost/sample.Q2.
9.
Click the Apply button.
10.
Choose File > Save from the menu.
Redefine the Resource Environment References in the Application Client Samples
1.
Expand MDBSamples > Application Clients > PSSampleClient > Resource Environment References.
2.
In the content pane, choose jms/news and then click the Bindings tab.
3.
Change the value of the JNDI name from thisNode/servers/server1/Sample/JMS/news to tibjmsnaming://localhost/sample.news.
4.
Click the Apply button.
5.
Choose jms/sport and then click the Bindings tab.
6.
Change the value of the JNDI name from thisNode/servers/server1/Sample/JMS/sport to tibjmsnaming://localhost/sample.sport.
7.
Click the Apply button.
8.
Choose jms/weather and then click the Bindings tab.
9.
Change the value of the JNDI name from thisNode/servers/server1/Sample/JMS/weather to tibjmsnaming://localhost/sample.weather.
10.
Expand MDBSamples > Application Clients > PtoPSampleClient > Resource Environment References.
11.
Choose jms/Q1 and then click the Bindings tab.
12.
Change the value of the JNDI name from thisNode/servers/server1/Sample/JMS/Q1 to tibjmsnaming://localhost/sample.Q1.
13.
Click the Apply button.
14.
Choose jms/Q2 and then click the Bindings tab.
15.
Change the value of the JNDI name from thisNode/servers/server1/Sample/JMS/Q2 to tibjmsnaming://localhost/sample.Q2.
16.
Click the Apply button.
17.
Choose File > Save, then File > Close to save and then close the Application Assembly tool.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > Client Modules > Using application clients > Developing J2EE application client code.
Add TIBCO Enterprise Message Service as a JMS Provider to the Application Client
1.
 
   install_root\AppServer\bin>clientConfig
2.
Open the MDBSamples.ear file located in the <install_root>/AppServer/samples/lib/MessageDrivenBeans directory.
3.
Expand PSSampleClient.jar.
4.
Right-click on JMS Providers and select New.
5.
 
EMS_HOME\jar\tibjms.jar
6.
Click the OK button.
7.
8.
Save the EAR file by choosing File > Save from the menu.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > Client Modules > Using application clients > Deploying application clients > Configuring Java messaging client resources > Configuring new JMS providers with the Application Client Resource Configuration Tool.
Configure the JNDI bindings for TIBCO Enterprise Message Service Connection Factories for the Application Client
1.
In the Application Client Resource Configuration Tool for the MDBSamples.ear file, expand PSSampleClient.jar > JMS Providers > TIBCO.
2.
Right-click on JMS Connection Factories and select New.
3.
 
4.
Click the OK button.
5.
Repeat the previous three steps for PtoPSampleClient.jar using the following values:
 
6.
Save the EAR file by choosing File > Save from the menu.
7.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > Client Modules > Using application clients > Deploying application clients > Configuring Java messaging client resources > Generic JMS connection factory settings for application clients.
Update the Deployed Application on the Server
1.
From the WebSphere Administrative Console, expand Applications and click on Enterprise Applications.
2.
Check the box in front of MDBSamples and click the Update button.
3.
Click the Browse button and locate the MDBSamples.ear file. On Windows, by default, it is located in: C:\Program Files\WebSphere\AppServer\samples\lib\MessageDrivenBeans.
4.
Click the Next button.
5.
6.
Click the Next button.
7.
8.
Click the Next button.
9.
The "Step 2, Provide Listener Ports for Messaging Beans" appears. It should already contain the names of the new listener ports previously created.
10.
Click the Next button.
11.
The "Step 3, Map resource references to resources" page appears. It should already contain the binding for the jms/SamplePPQCF reference for the PtoPSampleMDB.
12.
Click the Next button.
13.
The “Step 4, Map resource env entry references to resources” page appears. It should already contain the binding for the jms/SampleOutputQueue reference for the PtoPSampleMDB.
14.
Click the Next button.
15.
16.
Click the Next button.
17.
The "Step 6, Map modules to application servers" page appears. Do not change any of the default settings on this page.
18.
Click the Next button.
19.
20.
Click the Finish button.
21.
22.
Choose Save to Master Configuration.
23.
Click Save again.
More information about this task can be found in the WebSphere Application Server Version 5 Documentation On-line InfoCenter under: Applications > Deployment > Deploying and managing applications > Updating Applications.
Run the Samples Application Client
1.
From the <install_root>\samples\bin\MessageDrivenBeans directory, type: RunPSclient. You should see the same results as you saw in part I for the publish/subscribe sample.
2.
From the <install_root>\samples\bin\MessageDrivenBeans directory, type: RunPtoPclient. You should see the same results as you saw in part I for the point-to-point sample.