Exercise 1.2: Creating a server and server configuration for JMS
Before you begin, you must complete Exercise 1.1: Importing the required resources and building the required projects.
To create a JMS server:
- From the File menu, select New > Other >
Server > Server > Next.
- Select WebSphere v6.0 Server as the server type. Click Next.
- Accept the default server port and name. Click Next.
- Select the JMSEAR from the list of available projects and click Add
to target it to the server. Click Finish.
- Wait for the server to start. once it has started the console will display Server server1 open for e-business;
Configuring the server to work with JMS
JMS settings for this server must be set in the WebSphere Application
Server administrative console. The console can be launched through the Start
menu on Windows, or through a Web browser at: http://localhost:9060/ibm/console
- Once you have launched the console, select Servers > Application
Servers to ensure that the server you created is listed.
- In the left-hand pane, expand Service Integration > Buses
and click New.
Enter a unique name in the Name field (for example WS_tutorial_bus)
and click OK.
- To associate the current server with the newly created integration
bus, select the name of the bus you have just created, under Additional
Properties click Bus members. Click Add and select the server
you want to associate the integration bus and then click Next. Click Finish
to confirm and click Save to
save the changes.
- Create a physical queue for the request message:
- In the left-hand pane, expand Service Integration > Buses.
Select the bus created earlier.
- Under Additional Properties click Destinations.
- Click on New and choose Queue as
the destination type. Enter an identifier such as ws_tutorial_queueJms.
Click Next.
- Accept the default bus member. Click Next.
- Click Finish to confirm your changes, and then save your changes.
- Assign JMS settings against the newly created queue:
- In the
left-hand navigation panel, go to Resources > JMS Providers > Default Messaging.
- Under Destinations, click JMS
Queue, and then click on New.
- Enter a name (for example ws_tutorial_queueJms)
and JNDI name (for example jms/ws_tutorial_queue). In the connection
pane, select the bus (WS_tutorial_bus) and Queue (ws_tutorial_queueJms)
you created earlier.
- Click OK and save the changes.
- Create a queue connection factory for the input queue:
- Go to Resources > JMS Providers > Default Messaging.
- Under Connection Factories select JMS queue connection factory, click New and
enter a name (for example WebServicesInput_QCF) and a JNDI
name (for example jms/ws_tutorial_qcf ).
- Select the bus created earlier (WS_tutorial_Bus)
as the bus name.
- Click OK and save the changes.
- Create a queue connection factory for the reply queue:
- Go to Resources > JMS Providers > Default Messaging.
- Under JMS queue connection factory click New and
enter a name (for example WebServicesReply_QCF) and a JNDI
name (for example jms/WebServicesReplyQCF).
- Select the bus created earlier (WS_tutorial_Bus)
as the bus name and click OK and save the changes.
- A JMS activation specification is needed to bind the input queue
and the listening message driven EJB:
- Go to Resources > JMS Providers > Default Messaging.
- Under Activation specifications, click JMS
activation specification, click New, and
enter a name (for example ws_tutorial_JMSRouter), enter a JNDI
name (for example eis/ws_tutorial_JMSRouter), select Queue as
the destination type, enter the destination JNDI name (jms/ws_tutorial_queue),
and select the bus name (WS_tutorial_Bus).
- Click OK and save the changes.
- Once you have added the required connection factories and queues
or topics, you can stop and restart WebSphere Application Server v6, and return
to the Rational Developer product's workspace.
Now you are ready to begin Exercise 1.3: Creating the Web service.