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

Important: Applicable to WebSphere® Application Server traditional
In order to create a server, you must have installed at least one of WebSphere Application Server Version 7.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 information center and search for "messaging resources." For additional information on using service integration technologies with web services, refer to the WebSphere Application Server information center 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

Procedure

  1. From the File menu, select New > Other > Server > Server > Next.
  2. Select one of the versions of WebSphere Application 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. Expand Servers > Server Types > WebSphere application servers to ensure that the server you created is listed.
  9. Expand Service Integration > Buses and click New. Enter a unique name in the Name field (for example WS_test_bus) and click Next, unselect Bus security 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. In Local Topology, expand the name of your bus, expand Bus members, and then click Add. Select the server you want to associate the integration bus with 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. 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. 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. 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. 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. 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.