JMS Step 1 - How to Create a Simple JMS Queue in Weblogic Server 11g

JMS Step 1 - How to Create a Simple JMS Queue in Weblogic Server 11g

This example shows the steps to create a simple JMS queue in WebLogic Server 11g for testing purposes. For example, to use with the two sample programs QueueSend.java and QueueReceive.java which will be shown in later examples.

Additional, detailed information on JMS can be found in the following Oracle documentation:

Oracle® Fusion Middleware Configuring and Managing JMS for Oracle WebLogic Server
11g Release 1 (10.3.6)
Part Number E13738-06
http://docs.oracle.com/cd/E23943_01/web.1111/e13738/toc.htm

1. Introduction and Definitions

A JMS queue in Weblogic Server is associated with a number of additional resources:

JMS Server

A JMS server acts as a management container for resources within JMS modules. Some of its responsibilities include the maintenance of persistence and state of messages and subscribers. A JMS server is required in order to create a JMS module.

JMS Module

A JMS module is a definition which contains JMS resources such as queues and topics. A JMS module is required in order to create a JMS queue.

Subdeployment

JMS modules are targeted to one or more WLS instances or a cluster. Resources within a JMS module, such as queues and topics are also targeted to a JMS server or WLS server instances. A subdeployment is a grouping of targets. It is also known as advanced targeting.

Connection Factory

A connection factory is a resource that enables JMS clients to create connections to JMS destinations.

JMS Queue

A JMS queue (as opposed to a JMS topic) is a point-to-point destination type. A message is written to a specific queue or received from a specific queue.

The objects used in this example are:

Object Name

Type

JNDI Name

TestJMSServer

JMS Server

TestJMSModule

JMS Module

TestSubDeployment

Subdeployment

TestConnectionFactory

Connection Factory

jms/TestConnectionFactory

TestJMSQueue

JMS Queue

jms/TestJMSQueue

2. Configuration Steps

The following steps are done in the WebLogic Server Console, beginning with the left-hand navigation menu.

2.1 Create a JMS Server

  1. Services > Messaging > JMS Servers

  2. Select New
  3. Name: TestJMSServer
    Persistent Store: (none)
  4. Target: soa_server1  (or choose an available server)
  5. Finish

The JMS server should now be visible in the list with Health OK.

2.2 Create a JMS Module

  1. Services > Messaging > JMS Modules
  2. Select New
  3. Name: TestJMSModule
    Leave the other options empty
  4. Targets: soa_server1  (or choose the same one as the JMS server)
    Press
    Next
  5. Leave “Would you like to add resources to this JMS system module” unchecked and  press Finish .

2.3 Create a SubDeployment

A subdeployment is not necessary for the JMS queue to work, but it allows you to easily target subcomponents of the JMS module to a single target or group of targets. We will use the subdeployment in this example to target the following connection factory and JMS queue to the JMS server we created earlier.

  1. Services > Messaging > JMS Modules
  2. Select TestJMSModule
  3. Select the Subdeployments  tab and New
  4. Subdeployment Name: TestSubdeployment
  5. Press Next
  6. Here you can select the target(s) for the subdeployment. You can choose either Servers (i.e. WebLogic managed servers, such as the soa_server1) or JMS Servers such as the JMS Server created earlier. As the purpose of our subdeployment in this example is to target a specific JMS server, we will choose the JMS Server option.
    Select the
    TestJMSServer created earlier
  7. Press Finish

2.4  Create a Connection Factory

  1. Services > Messaging > JMS Modules
  2. Select TestJMSModule  and press New
  3. Select Connection Factory  and Next
  4. Name: TestConnectionFactory
    JNDI Name:
    jms/TestConnectionFactory
    Leave the other values at default
  5. On the Targets page, select the Advanced Targeting  button and select TestSubdeployment
  6. Press Finish

The connection factory should be listed on the following page with TestSubdeployment and TestJMSServer as the target.

2.5 Create a JMS Queue

  1. Services > Messaging > JMS Modules
  2. Select TestJMSModule  and press New
  3. Select Queue and Next
  4. Name: TestJMSQueue
    JNDI Name: jms/TestJMSQueue
    Template: None
    Press
    Next
  5. Subdeployments: TestSubdeployment
  6. Finish

The TestJMSQueue should be listed on the following page with TestSubdeployment and TestJMSServer.

Confirm the resources for the TestJMSModule. Using the Domain Structure tree, navigate to soa_domain > Services > Messaging > JMS Modules then select TestJMSModule

You should see the following resources

The JMS queue is now complete and can be accessed using the JNDI names

jms/TestConnectionFactory and
j
ms/TestJMSQueue.

In the following blog post in this series, I will show you how to write a message to this queue, using the WebLogic sample Java program QueueSend.java.

Comments:

Thank you for the helpful article :).

Posted by guest on July 11, 2013 at 12:38 AM PDT #

was quite helpfull..thanks

Posted by guest on March 18, 2014 at 05:20 AM PDT #

Not to forget to Activate the Weblogic after making all these changes. I got the
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'jms.TestConnectionFactory'. Resolved 'jms' error after doing the remaining steps.

Thanks for sharing.

Posted by guest on April 01, 2014 at 12:04 PM PDT #

gooD

Posted by guest on April 07, 2014 at 05:18 AM PDT #

Indeed the most simplest and concise online doc i have seen... keep it up, and look forward for more such blogs from you.

Posted by guest on April 23, 2014 at 04:39 AM PDT #

Good One

Posted by guest on April 25, 2014 at 06:42 AM PDT #

nice.

Posted by guest on May 15, 2014 at 04:24 AM PDT #

nice

Posted by guest on August 12, 2014 at 08:35 AM PDT #

more explanatory and helpful, Thanks.

Posted by guest on August 19, 2014 at 11:52 AM PDT #

thanks for article

Posted by guest on November 05, 2014 at 12:18 PM PST #

Very helpful article for beginners.
Thank you so much.

Posted by guest on December 01, 2014 at 11:46 PM PST #

By far the most simple explanation to create a JMS Queue in weblogic. But not sure why so many intermediary configurations like JMS Servers, JMS modules, etc to create a simple JMS Queue. But anyway, the tutorial was helpful. Thanks!

Posted by guest on December 09, 2014 at 01:13 PM PST #

This article is really helpful, especially for beginners.
Thanks a lot.

Posted by Mary on March 10, 2015 at 04:01 AM PDT #

Good one

Posted by guest on March 24, 2015 at 01:22 PM PDT #

Keep up the good work.

Posted by guest on April 02, 2015 at 05:42 PM PDT #

I have heard that setting up a JMS Queue is pretty tough the first time you try it. I managed to get it set up and working in about 20 minutes with no headaches. Thank you for this!

Posted by guest on April 09, 2015 at 04:42 PM PDT #

Excellent

Posted by guest on April 17, 2015 at 12:49 AM PDT #

very helpful for the beginners

Posted by guest on April 24, 2015 at 06:20 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the official blog of the SOA Proactive Support Team. Here we will provide information on our activities, publications, product related information and more. Additionally we look forward to your feedback to improve what we do.

Search

Categories
Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
     
Today