WebSphere Studio Application Developer 5.0 - Configuring Embedded Messaging for JMS

Introduction

IBM® WebSphere® Studio Application Developer is a powerful J2EE application development tool. Its WebSphere Unit Test Environment (UTE) is a key and unique J2EE IDE feature that allows developers to deploy and test their applications on their own workstations in an environment that is virtually identical to the target environment - WebSphere Application Server.

In this lab, we will be configuring WebSphere Embedded Messaging so we can test a Message Driven Bean we will develop in the next lab.

Note:  This workshop requires that the following products are installed:
  • WebSphere Studio Application Developer 5.0
  • DB2 Universal Database version 7.2 FP 7
  • WebSphere Application Server V5 Beta 4 (Full install)

Section 1: Configuring JMS Within Application Developer

___1. Configure the WebSphere v5 Unit Test Server Configuration

a. Start Application Developer and switch to a Server perspective.

b. In the Server Configuration view,  highlight the WebSphere v5 Unit Test configuration, click mouse button 2, and choose Open from the pop-up menu.

c. Click on the Configuration notebook tab at the bottom of the Configuration Editor.

d. Check the Enable administration client check box.

e. Hit Ctrl+S to save the changes and close the Editor.

___2.  Launch the Admin Client to Configure JMS within the WebSphere v5 Unit Test server.

a. From the Server view, highlight the WebSphere v5 Unit Test server, click mouse button 2 and choose Start from the pop-up menu.

b. Once the server has started successfully, switch from the Console view to the Servers view.

c. Highlight the WebSphere v5 Unit Test Server, click mouse button 2, and choose Run administrative client from the pop-up menu.



In a few moments the WebSphere Administrative Console should appear.

d. Enter your userid and click the OK button.



___3.  Create the QCF JMS Queue Connection Factory

a. From the tree view, expand Resources.  Click on the WebSphere JMS Provider link.

 

b. From the WebSphereJMSProvider frame, scroll down and click on the WebSphere Queue Connection Factories link.

 

c. From the WebSphere Queue Connection Factories frame click the New button.

d. From the New frame, enter the following:

Parameter
Value
Name
QCF
JNDI Name
jms/QCF

Click the OK button.
___4.  Create the Q1 JMS Queue Destination
a. Click the WebSphereJMSProvider link (as shown below)
 

b. Scroll down and click the WebSphere Queue Destinations link.

c. From the WebSphere Queue Destinations frame, click the New button.

d. From the New frame, specify the following:
Parameter
Value
Name
Q1
JNDI Name
jms/Q1

Click the OK button.

___5.  Create the JMSListener Listener Port

a. From the left-hand frame, expand Servers and click the Application Servers link.



b. From the Application Servers frame, click the server1 link.

c. Scroll down to the additional properties section and click the Message Listener Service link.



d. From the Configuration section, check the Startup checkbox so the server will start the Message Listener Service.

e. Click the Apply button.

f. Scroll down to Additional Properties and click the Listener Ports link.



g. From the Listener Ports frame, click the New button.

h. From the New frame, specify the following parameters:

Parameter
Value
Name
JMSListener
Connection Factory JNDI name
jms/QCF
Destination JNDI name
jms/Q1

Click the OK button.
___6.  Configure the Internal JMS Server
a. Click on the Application Servers link



b. Scroll down and click on the Server Components link

c. Click the JMS Servers link

d. Specify a Queue name of Q1.  Change the Initial State to Started.



e. Click the OK button.

f. Click the Save button (as shown below) to save your configuration changes.



g. From the Save frame, click the Save button.
h. Click the Logout button to end your session.
___7.  Stop the WebSphere v5 Unit Test Server
a. From the Servers view, highlight the WebSphere v5 Unit Test server, click mouse button 2, and choose Stop from the pop-up menu.

Section 2: Configuring the DB2 JDBC Driver for 2PC


Note: Since we want WebSphere MQ, DB2, and our EJBs to all participate in a managed transaction, we need to update the DB2 DataSource.

___1. Edit the DB2JDBCDriver Data Source
a. From the Server Configuration view, double-click the WebSphere v5 Unit Test configuration

b. Click on the Data source tab.

c. Highlight the DB2JDBCDriver and click the Edit... button.

d. From the Create a JDBC Provider dialog, change the implementation class name to com.ibm.db2.jdbc.DB2XADataSource.



e. Click the Finish button.

f. Hit Ctrl+S to save the changes and then close the editor.
Congratulations!  You've now configured WebSphere MQ and the WebSphere v5 Unit Test Server in WebSphere Studio Application Developer for messaging.  Part II of this workshop will take you through the steps of creating and testing a Message Driven Bean.