Get the Sample MDB running with TIBCO Enterprise Message Service
Create the TIBCO Enterprise Message Service Administered Objects
- Start the TIBCO Enterprise Message Service server.
- Start the admin tool and enter the following commands:
Configure WebSphere for the TIBCO Enterprise Message Service JNDI Provider
- Create a text file called jndi.properties in the directory <
install_root
>\AppServer\lib\ext
.
- Add the following line into the file:
- Save the jndi.properties file.
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
- Start the WebSphere application server (if you have not already done so).
- Start the WebSphere Administrative Console.
- Expand Resources and choose Generic JMS Providers.
- Click the New button.
- Enter the following values for the given properties:
Name
|
|
Description
|
|
Classpath
|
|
External Initial Context Factory
|
com.tibco.tibjms.naming.TibjmsInitialContextFactory
|
External Provider URL
|
tibjmsnaming:// localhost:7222
|
- Click the OK button.
- Click the Save button on the task bar at the top of the console window.
- To have the changes take effect immediately, stop and restart the application server.
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
- From the WebSphere Administrative Console, expand Resources and choose Generic JMS Providers.
- In the content pane, choose TIBCO.
- Scroll down and choose JMS Connection Factories.
- Click the New button.
- Enter the following values for the given properties:
Name
|
|
Type
|
|
JNDI Name
|
|
Description
|
Sample Topic ConnectionFactory
|
External JNDI Name
|
tibjmsnaming://localhost/sample.TCF
|
- Click the OK button.
- Click the New button.
- Enter the following values for the given properties:
Name
|
|
Type
|
|
JNDI Name
|
|
Description
|
Sample Queue ConnectionFactory
|
External JNDI Name
|
tibjmsnaming://localhost/sample.QCF
|
- Click the OK button.
- Click the Save button on the task bar of the Administrative Console (and Save again to confirm),
- To have the changes take effect immediately, stop and restart the application server.
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
- From the WebSphere Administrative Console, expand Resources and choose Generic JMS Providers.
- In the content pane, choose TIBCO.
- Scroll down and choose JMS Destinations.
- Click the New button.
- Enter the following values for the given properties:
Name
|
|
Type
|
|
JNDI Name
|
|
Description
|
Sample Listen Topic
|
External JNDI Name
|
tibjmsnaming://localhost/sample.listen
|
- Click the OK button.
- Repeat the previous steps to create the following additional destinations:
Name
|
Type
|
JNDI Name
|
Description
|
External JNDI Name
|
News
|
TOPIC
|
jms/news
|
Sample News Topic
|
tibjmsnaming://localhost/sample.news
|
Sport
|
TOPIC
|
jms/sport
|
Sample Sport Topic
|
tibjmsnaming://localhost/sample.sport
|
Weather
|
TOPIC
|
jms/weather
|
Sample Weather Topic
|
tibjmsnaming://localhost/sample.weather
|
Q1
|
QUEUE
|
jms/Q1
|
Sample Q1 Queue
|
tibjmsnaming://localhost/sample.Q1
|
Q2
|
QUEUE
|
jms/Q2
|
Sample Q2 Queue
|
tibjmsnaming://localhost/sample.Q2
|
- Click the Save button on the task bar of the Administrative Console (and Save again to confirm).
- To have the changes take effect immediately, stop and restart the application server.
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
- From the WebSphere Administrative Console, expand Servers and choose Application Servers.
- In the content pane, choose the name of the application server.
- In the Additional Properties Table, select Message Listener Service.
- In the content pane, select Listener Ports.
- In the content pane, click the New button.
- Enter the following values for the given listener port properties:
Name
|
|
Initial State
|
|
Description
|
|
ConnectionFactory JNDI Name
|
jms/ConnectionFactory
|
Destination JNDI Name
|
jms/Q1
|
- Click the OK button.
- Repeat the previous steps to create another listener port with the following property values:
Name
|
|
Initial State
|
|
Description
|
|
ConnectionFactory JNDI Name
|
jms/ConnectionFactory1
|
Destination JNDI Name
|
jms/listen
|
- Click the Save button on the task bar of the Administrative Console (and Save again to confirm).
- Stop and restart the application server to have the changes take effect.
- 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
- Start the WebSphere Application Assembly Tool.
- Open the
MDBSamples.ear
file located in the <
install_root
>/AppServer/samples/lib/MessageDrivenBeans
directory.
- In the navigation pane, expand MDBSamples->EJB Modules->PSSampleMDB.jar.
- Choose Message Driven Beans, then in the content pane, choose PSSampleMDB.
- Click the Bindings tab in the property pane.
- Change the value of the Listener Port Name from SamplePubSubListenerPort to TIBCOPubSubListenerPort.
- Click the Apply button.
- In the navigation pane, expand MDBSamples->EJB Modules->PtoPSampleMDB.jar.
- Choose Message Driven Beans, then in the content pane, choose PtoPSampleMDB.
- Click the Bindings tab in the property pane.
- Change the value of the Listener Port Name from SamplePtoPListenerPort to
TIBCOPtoPListenerPort
.
- Click the Apply button.
- 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
- In the navigation pane of the WebSphere Application Assembly Tool, under MDBSamples, expand EJBModules->PtoPSampleMDB.jar->Message Driven Beans->PtoPSampleMDB.
- Choose Resource References. The name JMS/SamplePPQCF should appear in the content pane.
- Click the
Bindings
tab.
- Change the value of
JNDI Name from Sample/JMS/QCF
to tibjmsnaming://localhost/sample.QCF
.
- Click the Apply button.
- In the navigation pane, choose Resource Environment References. The name JMS/SampleOutputQueue should appear in the content pane.
- Click the Bindings tab.
- Change the value of
JNDI Name from Sample/JMS/Q2
to tibjmsnaming://localhost/sample.Q2
.
- Click the Apply button.
- Choose File->Save from the menu.
Redefine the Resource Environment References in the Application Client Samples
- Expand MDBSamples->Application Clients->PSSampleClient->Resource Environment References.
- In the content pane, choose jms/news and then click the Bindings tab.
- Change the value of the JNDI name from
thisNode/servers/server1/Sample/JMS/news
to tibjmsnaming://localhost/sample.news
.
- Click the Apply button.
- Choose jms/sport and then click the Bindings tab.
- Change the value of the JNDI name from
thisNode/servers/server1/Sample/JMS/sport
to tibjmsnaming://localhost/sample.sport
.
- Click the Apply button.
- Choose jms/weather and then click the Bindings tab.
- Change the value of the JNDI name from
thisNode/servers/server1/Sample/JMS/weather
to tibjmsnaming://localhost/sample.weather
.
- Expand MDBSamples->Application Clients->PtoPSampleClient->Resource Environment References.
- Choose jms/Q1 and then click the Bindings tab.
- Change the value of the JNDI name from
thisNode/servers/server1/Sample/JMS/Q1
to tibjmsnaming://localhost/sample.Q1
.
- Click the Apply button.
- Choose jms/Q2 and then click the Bindings tab.
- Change the value of the JNDI name from
thisNode/servers/server1/Sample/JMS/Q2
to tibjmsnaming://localhost/sample.Q2
.
- Click the Apply button.
- 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
- Start the WebSphere Application Client Resource Configuration Tool from a console window by entering the following command:
- Open the
MDBSamples.ear
file located in the <
install_root
>/AppServer/samples/lib/MessageDrivenBeans directory.
- Expand
PSSampleClient.jar
.
- Right-click on JMS Providers and select New.
- Enter the following values for the given properties:
Name
|
|
Description
|
|
Classpath
|
|
ContextFactory Class
|
com.tibco.tibjms.naming.TibjmsInitialContextFactory
|
Provider URL
|
tibjmsnaming://localhost:7222
|
- Click the OK button.
- Repeat the previous three steps for
PtoPSampleClient.jar
.
- 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
- In the Application Client Resource Configuration Tool for the
MDBSamples.ear
file, expand PSSampleClient.jar->JMS Providers->TIBCO
.
- Right-click on JMS Connection Factories and select New.
- Enter the following values for the given properties:
Name
|
|
Description
|
|
JNDI Name
|
|
External JNDI Name
|
tibjmsnaming://localhost/sample.TCF
|
Connection Type
|
TOPIC
|
- Click the OK button.
- Repeat the previous three steps for
PtoPSampleClient.jar
using the following values:
Name
|
|
Description
|
|
JNDI Name
|
|
External JNDI Name
|
tibjmsnaming://localhost/sample.QCF
|
Connection Type
|
QUEUE
|
- Save the EAR file by choosing File->Save from the menu.
- Close the MDBSamples.ear file (File->Close).
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
- From the WebSphere Administrative Console, expand Applications and click on Enterprise Applications.
- Check the box in front of MDBSamples and click the Update button.
- 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
.
- Click the Next button.
- Do not change any of the default settings on this page.
- Click the Next button.
- The "Step 1, Provide options to perform the installation" page appears. Do not change any of the default settings on this page.
- Click the Next button.
- The "Step 2, Provide Listener Ports for Messaging Beans" appears. It should already contain the names of the new listener ports previously created.
- Click the Next button.
- The "Step 3, Map resource references to resources" page appears. It should already contain the binding for the jms/SamplePPQCF reference for the PtoPSampleMDB.
- Click the Next button.
- 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.
- Click the Next button.
- The "Step 5, Map virtual hosts for web modules" page appears. Do not change any of the default settings on this page.
- Click the Next button.
- The "Step 6, Map modules to application servers" page appears. Do not change any of the default settings on this page.
- Click the Next button.
- The "Step 7, Summary" page appears.
- Click the Finish button.
- The message "Application MDBSamples installed successfully" appears in the content window.
- Choose Save to Master Configuration.
- 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
- 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.
- 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.
TIBCO Enterprise Message Service™ Application Integration Guide
Software Release 4.3,
February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com
|