Configuring JMS Queues and Topics

Purpose

This tutorial explains the steps to configure Java Message Service (JMS) Queues and Topics in an Oracle WebLogic Server Instance. At the end of this tutorial, you will be able to::

 Configure JMS Server
 Configure JMS Queue and Topic
 Customize the Queue / Topic Display in Admin Console
 Test the working of JMS Queue and Topic

 

Time to Complete

Approximately 30 minutes

Topics

This OBE tutorial covers the following topics:

 Overview
 Scenario
 Starting up the Server instances in the Domain
 Configuring JMS Server
 Configuring JMS Queue and Topic
 Customizing the Queue / Topic Display in Administration Console
 Testing the working of JMS Queue and Topic
 Summary
 Related information

Viewing Screenshots

 Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

The screenshots are provided to give you an idea of how to configure and administer specific functionality in Oracle WebLogic Server and may not reflect the specific environment that you are using.

Overview

A JMS server implements the JMS infrastructure on a WebLogic server. Destinations (queues or topics) are targeted to a WebLogic server that has the JMS server configured.
In this tutorial you learn to configure a JMS server, a queue, and a topic . You will then post messages to the queue and topic and monitor them in the Administration Console. For reference.

Back to Topic List

Scenario

You are an application server administrator in the Dizzyworld Corporation. You have installed and configured the Oracle WebLogic Server for your enterprise. For information on how to install and configure Oracle WebLogic Server, please refer to these OBEs:

Installing and Configuring Oracle WebLogic Server

 Configuring Oracle WebLogic Server Managed Instances

Managing machines using the Administration Console

The Dizzyworld system architects decided to explore the JMS services by configuring a JMS server, a JMS module with JMS queue and JMS topic resources, and by deploying a simple messaging.war application to post messages to the queue and the topic..

 

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

Prerequisite tutorials:

Before starting this tutorial, you should complete the following prerequisite tutorials:

Installing and Configuring Oracle WebLogic Server

 Configuring Oracle WebLogic Server Managed Instances

Managing machines using the Administration Console

Minimum Hardware Requirements

Item Specification
Processor Speed 1 GHz
Memory 2 GB
Free Hard Disk Space 1 GB

Software Requirements

The system should have installed the following products:

Oracle WebLogic Server

Download the test_jms.zip file and save it in your machine where you would be performing the tasks.:Then extract the content in your local drive. In this sample, the files are extracted into /home/oracle/labs/wls103/testjms folder . The extract contains two files:

  File Name Description
1. messaging.war A simple Web application file used for testing the JMS queue and topics configured.
2. deploy_testjms.py A WLST script used for deploying the Web application.

 

Back to Topic List

Starting up the Servers in the Domain

The basic domain in this case consists of an Administration Server and a Managed Server (dizzy1). To start the two servers, perform the following steps:

1.

Invoke a new shell window and navigate to the bin subfolder under the folder where you have configured the domain For example:

$ cd / u01/app/oracle/product/Middleware/user_projects/domains/dizzyworld/bin .

 

2.

Run the startWebLogic.sh script to start the Administration Server..

 

3.

When prompted :with “ Enter username to boot WebLogic server”, enter the administrative user name you have setup when you created the domain. In this case user name “admin” is shown. Then enter the password for admin user when prompted with “ Enter password to boot WebLogic server”.

 

4.

This will start the Administration Server. Leave this shell window running..

 

5.

To start the Managed Server (dizzy1) in the domain, invoke another shell window and navigate to the bin subfolder in your domain

 

6.

Execute the following command: to start the managed server.

$ ./startManagedWebLogic.sh dizzy1 http://localhost:7001

 

7.

When prompted :with “ Enter username to boot WebLogic server”, enter the administrative user name you have setup when you created the domain. In this case user name “admin” is shown. Then enter the password for admin user when prompted with “ Enter password to boot WebLogic server

 

 

8.

This would start up the Managed Server. Once again, leave this window as it is..

 

Back to Topic List

Configuring JMS Server Using Admin Console

1.

Access the Admin Console and click JMS Servers under Services of Domain Configurations section. Then click Lock & Edit in the Change Center

 

2.

Click New under the JMS Servers table to create a new JMS Server.

 

3.

Specify the following properties and click Next:

 Name dizzyworldJMSServer
 Persistent Store (none)

 

4.

Select dizzy1 as the target JMS server. Click Finish.

 

5.

Click Activate Changes to give effect to the changes.

 

Back to Topic List

Configuring JMS Queue and Topic

1.

In the Admin Console, navigate to dizzyworld > Services > Messaging > JMS Modules. Then click Lock & Edit in the Change Center.

 

2.

Click New on the JMS Modules table and specify the following properties and click Next

 Name dizzyworldModule
 Descriptor File Name dizzyworldModule

 

3.

Select dizzy1 Managed Server as target. Click Next :

 

4.

Select the checkbox for Would you like to add resources to this JMS system module and click Finish.

 

5.

In the Settings for dizzyworldModule page, click the Subdeployments tab

 

6.

In the Subdeployments table, click New. Enter dizzysubmodule as the Subdeployment Name and click Next

 

7.

.In the Targets page, select the dizzyworldJMSServer as the target under the JMS Servers table. Click Finish

 

8.

Click the Configuration tab .

9.

In the Settings for dizzyworldModule page under the Summary of Resources table, click New to configure a new JMS queue for the JMS module.

 

10.

In the Create a New JMS System Module Resource page under Choose the type of resource you want to create, select Queue , and then click Next .

 

11.

In the JMS Destination Properties, specify the following parameters and click Next

 Name dizzyworldQueue
 JNDI Name dizzyworldQueue
 Template None

 

12.

Select dizzysubmodule from the subdeployments list. Click Finish.

 

13.

In the Settings for dizzyworldModule page, click New under the Summary of Resources table to configure a new JMS topic for the JMS module

 

14.

In the Create a New JMS System Module Resource page, select Topic as the type of resource you want to create, and c lick Next. .

 

15.

In the JMS Destination Properties, specify the following parameters, and click Next.

 Name dizzyworldTopic
 JNDI Name dizzyworldTopic
 Template None

 

16.

Select dizzyworldsubmodule from the subdeployments list. Click Finish.

 

17.

Back in the Change Center, click Activate changes

 

18.

Navigate to Home. In the home page, under Environment, click Servers to get to the Summary of Servers. In the table of servers, click dizzy1.

 

19.

In the Settings for dizzy1 page, click View JNDI Tree

 

20.

The JNDI Tree opens in another window or tab. In that tab notice the JNDI entries dizzyworldQueue and dizzyworldTopic under the dizzy1 managed server

 

Back to Topic List

Customizing the Queue / Topic Display in Administration Console

1.

Access the Admin Console and click JMS Modules under Services section of Domain Configurations. Click dizzyworldModule link in the JMS Modules table.

 

2.

Scroll down in the Configuration tab of Settings for dizzyworldModule. Click dizzyworldQueue link in the Summary of Resources table.

 

3.

Click Monitoring tab in the Settings for dizzyworldQueue.

 

4.

Click Customize this table in the Monitoing page..

 

5.

Select Messages Total from Available column and click the right arrow to move it Chosen. Then click Apply.

 

6.

Notice that Messages Total appears as one of the columns in the table. .

 

Back to Topic List

Testing the working of JMS Queue and Topic

1.

Open a new shell window, navigate to the folder where you have the messaging.war application (for example: /home/labs/wls103/testjms folder).

 

2.

Set WL_HOME environment variable to point to the location where you have installed WLS 10.3..

 

3.

Run WL_HOME/server/bin/setWLSEnv.sh script to set up the environment variables.

 

4.

Run the command java weblogic.WLST deploy_testjms.py to deploy the testds.war application.

 

5.

Open a Web browser and navigate to http://localhost:7003/messaging

Using the application, post several messages to the standard queue and to the topic. Do not add messages to the distributed queue .

 

6.

In the Admin console navigate to dizzyworld > Services > Messaging > JMS Modules. In the JMS Modules table, click dizzyworldModule. In the Summary of Resources table, click dizzyworldQueue . and then click the Monitoring tab. Notice that the Messages High and Messages Total column show non zero values indicating new messages have been recieved. .

 

7.

Repeat these steps to view the number to messages sent to the dizzyworldTopic .

Note: On the topic (unlike the queue), Messages High value remains zero, since there are no consumers connected to the topic, posted messages are automatically deleted from the server. For a queue, messages are saved on the server until they are consumed..

 

That completes the OBE.

Back to Topic List

Summary

In this lesson, you learned how to:

 Configure JMS Server
 Configure JMS Queue and Topic
 Customize the Queue / Topic Display in Admin Console
 Test the working of JMS Queue and Topic

Related Information

 To ask a question about this OBE tutorial, post a query on the OBE Discussion Forum.

Back to Topic List

 Place the cursor over this icon to hide all screenshots.

 

 

 

Left Curve
Popular Downloads
Right Curve
Untitled Document