> Configure WebSphere to Use EMS as the JMS Provider
> This section describes the steps required to configure WebSphere Application Server 6.1 to use TIBCO Enterprise Message Service as its JMS provider. The configuration process is described in the following steps:

> ● | Add TIBCO Enterprise Message Service as a JMS Provider

> ● | Configure JNDI Bindings for the Connection Factories

> ● | Configure JNDI Bindings for the Destinations

> ● | Create new Listener Ports

> ● | Install the MDB to Use the Topic and Queue Listeners

> After the application server is configured, the section Run the Sample Application Clients gives steps for running the sample Java clients to test the configuration.
> This section assumes that an MDB is already configured in the WebSphere Application Server, and that the required administered objects have been created in the EMS server, as described above in Create TIBCO Enterprise Message Service Administered Objects.
> Add TIBCO Enterprise Message Service as a JMS Provider
> This section configures WebSphere to uses TIBCO Enterprise Message Service as a JMS provider.

> 1. | Start the WebSphere application server.

> 2. | Start the WebSphere Administrative Console.

> 3. | In the WebSphere navigation pane, choose Resources > JMS > JMS providers.

> 4. | In the content pane, click the New button.

> 5. | Enter the following values for the required properties:

> Name | TIBCO
> Description | TIBCO Enterprise Message Service
> Classpath | EMS_HOME\jar\tibjms.jar
> External Initial Context Factory | com.tibco.tibjms.naming.TibjmsInitialContext Factory
> External Provider URL | tibjmsnaming://localhost:7222

> 6. | Click the OK button.

> 7. | Click the Apply button.

> For more information about this task, review the WebSphere Application Server documentation for defining a generic JMS provider.
> Configure JNDI Bindings for the Connection Factories
> This section describes how to create topic and queue connection factories in the WebSphere server.
> Create a Topic Connection Factory

> 1. | In the WebSphere navigation pane, choose Resources > JMS > Topic connection factories.

> 2. | In the content pane, click the New button.

> 3. | Choose TIBCO as the resource provider, and click OK.

> 4. | Enter the following values for the required properties:

> Name | TIBCOConnectionFactory1
> Type | TOPIC
> JNDI Name | jms/ConnectionFactory1
> Description | Sample Topic ConnectionFactory
> External JNDI Name | sample.TCF

> 5. | Click the OK button.

> Create a Queue Connection Factory

> 6. | In the WebSphere navigation pane, choose Resources > JMS > Queue connection factories.

> 7. | Click the New button.

> 8. | Choose TIBCO as the resource provider, and click OK.

> 9. | Enter the following values for the required properties:

> Name | TIBCOConnectionFactory2
> Type | QUEUE
> JNDI Name | jms/ConnectionFactory2
> Description | Sample Queue ConnectionFactory
> External JNDI Name | sample.QCF

> 10. | Click the OK button.

> 11. | Click the Save button.

> Configure JNDI Bindings for the Destinations
> This section describes how to bind the EMS topics sample.listen and sample.weather and queue sample.Q1 in WebSphere.
> Add Topics

> 1. | In the WebSphere navigation pane, choose Resources > JMS > Topics.

> 2. | In the content pane, click the New button.

> 3. | Choose TIBCO.

> 4. | Enter the following values for the required properties:

> Name | Listen
> Type | TOPIC
> JNDI Name | jms/listen
> Description | Sample Listen Topic
> External JNDI Name | sample.listen

> 5. | Click the OK button.

> 6. | Repeat the previous steps to create a topic with these properties:

> Name | Weather
> Type | TOPIC
> JNDI Name | jms/weather
> Description | Sample Weather Topic
> External JNDI Name | sample.weather

> Add the Queue

> 7. | In the WebSphere navigation pane, choose Resources > JMS > Queues.

> 8. | In the content pane, click the New button.

> 9. | Choose TIBCO.

> 10. | Enter the following values for the required properties:

> Name | Q1
> Type | QUEUE
> JNDI Name | jms/Q1
> Description | Sample Q1 Queue
> External JNDI Name | sample.Q1

> 11. | Click the OK button.

> 12. | Click the Save button.

> Create new Listener Ports
> This section creates the WebSphere listener ports that connect to the tibemsd. You create two listener ports:

> ● | TIBCOPubSubListenerPort for the configured topics.

> ● | TIBCOPtoPListenerPort for the configured queue.

> To create the listener ports:

> 1. | In the WebSphere navigation pane, choose Servers > Application servers, and choose the name of the application server.

> 2. | In the content pane, scroll down to the Communications section and click Message Listener Service.

> 3. | In the content pane, select Listener Ports.

> Create a Listener Port for Topics

> 4. | Click the New button.

> 5. | Enter the following values for the required listener port properties:

> Name | TIBCOPubSubListenerPort
> Initial State | Started
> Description | Listener Port for TIBCO PubSub
> ConnectionFactory JNDI Name | jms/ConnectionFactory1
> Destination JNDI Name | jms/listen

> 6. | Click the OK button.

> Create a Listener Port for a Queue

> 7. | Repeat the previous steps to create another listener port with the following property values:

> Name | TIBCOPtoPListenerPort
> Initial State | Started
> Description | Listener Port for TIBCO Point to Point
> ConnectionFactory JNDI Name | jms/ConnectionFactory2
> Destination JNDI Name | jms/Q1

> 8. | Click the OK button.

> 9. | Click the Save button.

> For more information about this task, review the WebSphere Application Server documentation for adding a new listener port.
> Install the MDB to Use the Topic and Queue Listeners
> This section describes the steps needed to install your MDB for the topic and queue listeners created above, in Create new Listener Ports.
> Install the Topic MDB

> 1. | In the navigation pane, choose Applications > Enterprise Applications.

> 2. | In the content pane, click the Install button.

> 3. | Specify the location of your message driven bean .ear file.

> 4. | Click the Next button.

> 5. | Change the Application name property to test_topic.

> Note that you do not need to change any of the other default installation options.

> 6. | Click the Next button.

> 7. | Click the Next button to accept the default module to application server mapping.

> Note that this mapping can be modified only if you have more than one WebSphere application server configured.

> 8. | Change the value of the Listener Port Name to TIBCOPubSubListenerPort.

> TIBCOPubSubListenerPort is the listener port created above in step 5 of Create new Listener Ports.

> 9. | Click Next.

> 10. | Click Finish to complete the installation.

> 11. | Save the changes to the Master Configuration by clicking the Save button.

> Install the Queue MDB

> 12. | In the navigation pane, you should still be in Applications > Enterprise Applications.

> 13. | In the content pane, click the Install button.

> 14. | Specify the location of your message driven bean .ear file.

> 15. | Click the Next button.

> 16. | Change the Application name to test_queue.

> Note that you do not need to change any of the other default installation options.

> 17. | Click the Next button.

> 18. | Click the Next button to accept the default module to application server mapping.

> Note that this mapping can be modified only if you have more than one WebSphere application server configured.

> 19. | Change the value of the Listener Port Name to TIBCOPtoPListenerPort.

> TIBCOPtoPListenerPort is the listener port created above in step 7 of Create new Listener Ports.

> 20. | Click Next.

> 21. | Click Finish to complete the installation.

> 22. | Save the changes to the Master Configuration by clicking the Save button.

> Restart the Application Server

> 23. | Stop and restart the application server to have your changes take effect.

> 24. | 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.
> For more information about this task, review the WebSphere Application Server documentation for configuring deployment attributes for a message-driven bean.
> Run the Sample Application Clients
> In this section, you run the sample Java clients included with your TIBCO Enterprise Message Service installation. If this is the first time you have used these sample clients, you will need to compile them before following the steps described here.

> 1. | From the EMS_HOME\samples\java directory, type the command:

> > java tibjmsTopicPublisher -topic sample.listen "hello world"

> 2. | From the EMS_HOME\samples\java directory, type the command:

> > java tibjmsTopicPublisher -topic sample.weather "hello world 2"

> 3. | From the EMS_HOME\samples\java directory, type the command:

> > java tibjmsQueueSender -queue sample.Q1 "hello world 3"

> 4. | Open the WebSphere application server log, located in <installation_directory>\logs\<your server>\SystemOut.log, and verify that the WebSphere MDB consumed the sent messages. The log should contain messages sent to the following destinations:

> Destination | Message
> sample.listen | hello world
> sample.weather | hello world 2
> sample.Q1 | hello world 3

Copyright © TIBCO Software Inc. All Rights Reserved.