Creating a JMS server

In order to create a web service that uses JMS transports, you need to first create and configure a server that can support JMS.

Before you begin

In order to create a server, you must have installed at least one of WebSphere® Application Server v8.0 or the WebSphere Application Server legacy test environments. JMS web services are only supported on WebSphere Application Server.

About this task

The following steps will guide you through basic service integration bus and JMS queue creation using the default messaging provider included with WebSphere Application server. Service integration technologies replaced the embedded messaging provider used in previous versions of the product. These instructions are not a definitive guide to how to use web services with service integration technologies, however they can be used as a guide when setting up topics and queues to handle JMS messages.

For additional information about the default messaging provider, including more detailed information on JMS and why and how to set up queues and topics for JMS, refer to the WebSphere Application Server infocenter and search for "messaging resources." For additional information on using service integration technologies with web services, refer to the WebSphere Application Server infocenter and search for "Enabling web services through service integration technologies."

Create a server and service integration bus for SOAP over JMS using WebSphere Application Server v6.1

About this task

In order to complete the steps in this section you must have WebSphere Application Server v6.1 installed.

Procedure

  1. Select File > New > Other > Sever > Sever > Next.
  2. Enter a name for the server, and ensure that the server type is WebSphere 6.1 server. Click Finish.
  3. In the Java™ EE perspective, from the Window menu select View > Other >Servers This will open the server view and your server should be listed.
  4. 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
  5. Once you have launched the console, select Servers > Application Servers to ensure that the server you created is listed.
  6. In the left-hand pane, expand Service Integration > Buses > New. Enter a unique name in the Name field (for example WS_test_Bus) and click OK.
  7. To associate the current server with the newly created integration bus, select the name of the bus you have just created, under Topology click Bus members. Click Add and select the server you want to associate the integration bus and then click Next. Select File store as the message persistence state and click Next. You can accept the default message store properties for this tutorial and click Next. If you are creating a JMS bus for your own web service, select Help and search on "File store settings" for additional information about which settings are best for you. Click Finish to confirm.
  8. Create a physical queue for the request message:
    1. In the left-hand pane, expand Service Integration > Buses. Select the bus created earlier.
    2. Under Destination resources click Destinations.
    3. On the destinations page click on New .
    4. Choose Queue as the destination type and click Next.
    5. Enter an identifier such as ws_test_queueJms. Click Next
    6. Accept the default bus member. Click Next.
    7. Click Finish to confirm your changes, and then save your changes.
  9. Assign JMS settings against the newly created queue:
    1. In the left-hand navigation panel, go to Resources > JMS > JMS Providers.
    2. From the Scope drop-down list select the server as your scope, and from the provider list select Default messaging provider.
    3. Under Additional Properties select Queue.
    4. Enter a name (for example ws_test_queueJms) and JNDI name (for examplejms/ws_test_queue). In the connection pane, select the bus (WS_test_bus) and Queue (ws_test_queueJms) you created earlier.
    5. Click OK to save the changes.
  10. Create a queue connection factory for the input queue:
    1. Go to Resources > JMS > Queue connection factories.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Under General Properties enter a name (for example WebServicesInput_QCF) and a JNDI name (for example jms/ws_test_qcf ).
    5. In the Connection pane select the bus created earlier (WS_test_Bus) as the bus name.
    6. Click OK to save the changes.
  11. Create a queue connection factory for the reply queue:
    1. Go to Resources > JMS > Queue connection factories.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Under General Properties enter WebServicesReply_QCF as the name (you must use WebServicesReply_QCF for this field) and a JNDI name (for examplejms/WebServicesReplyQCF). If you want to use a custom name for the reply queue connection factory you have to change the reference alias in the JMSServiceRouter deployment descriptor. This reference is set up when you run the web service wizards. Thus if you decide to use a different JNDI name you have to go into this project and override the default setting.
    5. In the Connection pane select the bus created earlier (WS_test_Bus) as the bus name and click OK to save the changes.
  12. A JMS activation specification is needed to bind the input queue and the listening message driven EJB:
    1. Go to Resources > JMS > Activation specifications.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Enter a name (for example ws_test_JMSRouter), and enter a JNDI name (for example eis/ws_test_JMSRouter). In the Destination pane select Queue as the destination type, enter the destination JNDI name (jms/ws_test_queue), and select the bus name (WS_test_Bus).
    5. Click OK to save the changes.
  13. Once you have added the required connection factories and queues or topics, you can stop and restart WebSphere Application Server v6.1, and return to the workspace.

Create a server and service integration bus for SOAP over JMS using WebSphere Application Server v7.0 or v8.0

Procedure

  1. From the File menu, select New > Other > Server > Server > Next.
  2. Select WebSphere v7.0 Server or WebSphere v8.0 Server as the server type. Click Next.
  3. If this runtime has not been created in your workspace, you will be prompted to select the installation directory for the server. Click Next.
  4. Accept the default server port and name. Click Next.
  5. Select the JMSEAR from the list of available projects and click Add to target it to the server. Click Finish.
  6. Wait for the server to start. once it has started the console will display Server server1 open for e-business;
  7. Launch the administrative console by right-clicking the server in your Servers view and selecting Administration > Run administrative console.
  8. In the console, select Servers > Application Servers to ensure that the server you created is listed.
  9. In the left-hand pane, expand Service Integration > Buses and click New. Enter a unique name in the Name field (for example WS_test_bus) and click Next and then Finish.
  10. To associate the current server with the newly created integration bus, select the name of the bus you have just created, under Topology click Bus members. Click Add and select the server you want to associate the integration bus and then click Next. Select File store as the message persistence state and click Next. You can accept the default message store properties for this tutorial and click Next. If you are creating a JMS bus for your own web service, select Help and search on "File store settings" for additional information about which settings are best for you. Click Finish to confirm.
  11. Create a physical queue for the request message:
    1. In the left-hand pane, expand Service Integration > Buses. Select the bus created earlier (WS_test_bus).
    2. Under Destination resources click Destinations.
    3. On the destinations page click New .
    4. Choose Queue as the destination type and click Next.
    5. Enter an identifier such as ws_test_queueJms. Click Next
    6. Accept the default bus member. Click Next.
    7. Click Finish to confirm your changes, and then save your changes.
  12. Assign JMS settings against the newly created queue:
    1. In the left-hand pane, go to Resources > JMS > JMS Providers.
    2. From the Scope drop-down list select the server as your scope, and from the provider list select Default messaging provider.
    3. Under Additional Properties select Queues. Click New.
    4. Enter a name (for example ws_test_queueJms) and JNDI name (for examplejms/ws_test_queue). Select the bus (WS_test_bus) and Queue (ws_test_queueJms) you created earlier.
    5. Click OK to save the changes.
  13. Create a queue connection factory for the input queue:
    1. In the left-hand pane select Resources > JMS > Queue connection factories.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Under General Properties enter a name (for example WebServicesInput_QCF) and a JNDI name (for example jms/ws_test_qcf ).
    5. In the Connection pane select the bus created earlier (WS_test_Bus) as the bus name.
    6. Click OK to save the changes.
  14. Create a queue connection factory for the reply queue:
    1. In the left-hand pane select Resources > JMS > Queue connection factories.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Under General Properties enter WebServicesReply_QCF as the name (you must use WebServicesReply_QCF for this field) and a JNDI name (for example jms/WebServicesReplyQCF). If you want to use a custom name for the reply queue connection factory you have to change the reference alias in the JMSServiceRouter deployment descriptor. This reference is set up when you run the web service wizards. Thus if you decide to use a different JNDI name you have to go into this project and override the default setting.
    5. In the Connection pane select the bus created earlier (WS_test_Bus) as the bus name and click OK to save the changes.
  15. A JMS activation specification is needed to bind the input queue and the listening message driven EJB:
    1. In the left-hand pane select Resources > JMS > Activation specifications.
    2. From the Scope drop-down list select the server as your scope, and click New.
    3. Select the default messaging provider and click OK.
    4. Enter a name (for example ws_test_JMSRouter), and enter a JNDI name (for example eis/ws_test_JMSRouter). In the Destination pane select Queue as the destination type, enter the destination JNDI name (jms/ws_test_queue), and select the bus name (WS_test_Bus).
    5. Click OK to save the changes.
  16. Once you have added the required connection factories and queues or topics, save your configuration. Stop and restart WebSphere Application Server and return to the development workspace.

Feedback