Configure the server: Enable your instance to use Java Message Service (JMS)

A JMS provider enables asynchronous messaging based on the Java Messaging Service (JMS). It provides J2EE connection factories to create connections for specific JMS queue or topic destinations. See the Administer JMS resources topic for more information.

  1. Enable embedded JMS for your application server. For more information, see Administer the embedded JMS server.

  2. Start your instance.

  3. Start the WebSphere Application Server administrative console. To start the console, open this URL in your browser:

    http://your.server.name:port/admin

    where your.server.name is the hostname of your iSeries server and port is your administrative port number. See the The administrative console topic for more information.

  4. Create a new J2C Authentication Data Entry for use with JMS connection factories.

    • In the topology tree, expand Security -> JAAS Configuration, and click J2C Authentication Data.
    • Click New.
    • In the Alias field, specify the name of the authentication data entry. For the message-driven beans sample application, specify mdb.
    • Use any valid user profile and password.

      Note: The user profile and password you specify must also be a valid iSeries server user ID and password.

    • Click OK.

  5. Configure your JMS connection factory. A topic connection factory is used to create connections to the associated JMS provider of JMS topic destinations for publish and subscribe messaging.

    • In the topology tree, expand Resources, and click WebSphere JMS Provider.
    • Scroll down to the bottom of the page, and click WebSphere Topic Connection Factories.
    • Click New.
    • In the Name field, specify SampleJMSTopicConnectionFactory.
    • In the JNDI name field, specify Sample/JMS/TCF.
    • In the Component-managed Authentication Alias field, select mdb from the drop-down list. This is the Authentication Data Entry you created in the previous step.
    • In the Container-managed Authentication Alias field, select mdb from the drop-down list.
    • In the Client ID field, specify MDBSampleClientID.
    • Click Apply.

  6. Configure your JMS topic resources. For the message-driven beans sample application, create four separate topics.

    • In the topology tree, expand Resources, and click WebSphere JMS Provider.
    • Scroll down to the bottom of the page, and click WebSphere Topic Destinations.
    • Click New.
    • In the Name field, specify Sample.JMS.listen.
    • In the JNDI name field, specify Sample/JMS/listen.
    • In the Topic field, specify Sample/JMS/listen.
    • Click OK.
    • Repeat the steps above to create the next topic, using the following values:

      • In the Name field, specify Sample.JMS.news.
      • In the JNDI name field, specify Sample/JMS/news.
      • In the Topic field, specify Sample/JMS/news.
      • Click OK.

    • Repeat the steps above to create the next topic, using the following values:

      • In the Name field, specify Sample.JMS.sport.
      • In the JNDI name field, specify Sample/JMS/sport.
      • In the Topic field, specify Sample/JMS/sport.
      • Click OK.

    • Repeat the steps above to create the next topic, using the following values:

      • In the Name field, specify Sample.JMS.weather.
      • In the JNDI name field, specify Sample/JMS/weather.
      • In the Topic field, specify Sample/JMS/weather.
      • Click OK.

  7. Configure your JMS listener port.

    • In the topology tree, expand Servers, and click Application Servers.
    • Click your application server.
    • Scroll down to the bottom of the page, and click Message Listener Service.
    • Click Listener Ports, and click New.
    • In the Name field, specify SamplePubSubListenerPort.
    • In the ConnectionFactory JNDI name field, specify Sample/JMS/TCF.
    • In the Destination JNDI name field, specify Sample/JMS/listen.
    • In the Maximum sessions field, specify 5.
    • In the Maximum retries field, specify 2.
    • In the Maximum messages field, specify 1.
    • Click OK.

  8. Save your administrative configuration.

    • In the Messages box at the top of the page, click Save.
    • Click Save to save your changes to the master configuration.

  9. Click Logout on the toolbar, and close your browser.

  10. Restart your application server instance.

    • Enter the Start Qshell (STRQSH) command on an OS/400 command line.
    • On the Qshell command line, enter this command:

      stopServer -instance mdbconfig serverName

      where mdbconfig is the name of the instance you want to stop and serverName is the name of the server you want stop.

    • On the Qshell command line, enter this command:

      startServer -instance mdbconfig serverName

      where mdbconfig is the name of the instance you want to start and serverName is the name of the server you want start.

Continue Next: Set up security (optional)