JMS STEP 2 : HOW TO CREATE A SIMPLE JMS QUEUE IN WEBLOGIC SERVER

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

ExtXfaceJMSServer

JMS Server

 

extXfaceJMSModule

JMS Module

 

extXfaceSubdeployment

Subdeployment

 

ReceiverQCF

Connection Factory

 

ReceiverQueue

JMS Queue

 

Configuration Steps

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

2.1 Create Persistent store-

Domain Structure

Domain Structure

Create File Store

File Store

2.2 Create a JMS Server-

JMS Server

JMS Server3

Create New JMS Server

Create New JMS Server

Create New JMS Server

The JMS server should now be visible in the list.

JMS Server

2.3 Create a JMS Module

Domain Structure - JMS Module

JMS Module

JMS Module

JMS Module Target

Leave “Would you like to add resources to this JMS system module” unchecked and press Finish .

JMS Module Create

JMS Module Table

2.4 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.

JMS Module Table

SubDeployment

Create New SubDeployment

SubDeployment Target

2.5 Create a Connection Factory

Connection Factory

 

Connection Factory - Summary of Resources

Connection Factory - Create New

Connection Factory - Properties

2.6 Create a JMS Queue

JMS Queue

JMS Queue Summary of Resources

JMS Queue Select Resource

JMS Queue - Create New

JMS Queue - Subdeployment

The ReceiverQueue should be listed on the following page with Sub-deployment as ExtxfaceReceiverSubDep and target as ExtxfaceReceiverServer.

JMS Queue - Subdeployment - Summary of Resources

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

JMS Queue - Subdeployment - Resource StructureYou should see the following resources-

JMS Queue - Subdeployment - Summary of Resources

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

ExtSystemReceiverQCF And ExtSystemReceiverQueue.

Note: Repeat the above process from the step Create JMS Server to create the JMS Configuration for Sender. Separate JMS Server , Module and Queues would get created for Sender.
After Creating the JMS configuration for both the Receiver and sender you have to manually deploy the ExtxfaceSimulatorMDB.ear on weblogic server.

Note: Whenever a new Entity is created within a setup the following mentioned steps should be followed in order to enable support for MultiEntity.

In order to enable the support for newly created Entity, Sender/ Receiver Connection Factories and Queues are needed to be created within a new Sender/ Receiver JMS Modules. These modules can be hosted on the same Sender/ Receiver JMS server created as per the steps defined in section (Create JMS Server) for the earlier Entity.

 

JMS Module Name

Sender JMS Module

ExtxfaceSenderModule2

Receiver JMS Module

ExtxfaceReceiverModule2

 

JMS Module Name

SubDeployment Name

Sender JMS Module

ExtxfaceSenderModule2

ExtxfaceReceiverSubDep2

Receiver JMS Module

ExtxfaceReceiverModule2

ExtxfaceSenderSubDep2

• Create Sender/Receiver connection factories within newly created module by following the steps defined in the section(Creating Connection Factories), with different names as follows-

 

Connection Factory Name

Connection Factory JNDI Name

Sender Connection Factory

ExtxfaceSenderQCF2

ExtSystemSenderQCF2

Receiver Connection Factory

ExtxfaceReceiverQCF2

ExtSystemReceiverQCF2

 

 

JMS Queue Name

JMS Queue JNDI Name

Sender JMS Queue

ExtxfaceSenderQueue2

ExtSystemSenderQueue2

Receiver JMS Queue

ExtxfaceReceiverQueue2

ExtSystemReceiverQueue2

 

After creating the new JMS sender/receiver modules, connection factories and queues by following the above defined steps. Further Redeploy the ExtxfaceSimulatorMDB.ear with the following changes -

XML

Fig.1 ExtxfaceSimulatorMDB.ear\com.ofss.digx.extxface.mdb.jar\META-INF\ejb-jar.xml

 

<message-driven>

<display-name>ExtxfaceSimulatorMDB2</display-name>

<ejb-name>ExtxfaceSimulatorMDB2</ejb-name>

<ejb-class>com.ofss.digx.extxface.mdb.ExtxfaceSimulatorMDB</ejb-class>

<transaction-type>Bean</transaction-type>

<message-destination-type>javax.jms.Queue</message-destination-type>

</message-driven>

Note: As Shown in above example the value of the <ejb-class> sub-tag in <message-driven> tag should be same for all the Entities.

 

Weblogic

Fig.2 ExtxfaceSimulatorMDB.ear\com.ofss.digx.extxface.mdb.jar\META-INF\weblogic-ejb-jar.xml

 

<weblogic-enterprise-bean>

<ejb-name>ExtxfaceSimulatorMDB2</ejb-name>

<dispatch-policy>ExtxfaceWorkManager</dispatch-policy>

<message-driven-descriptor>

<pool>

<initial-beans-in-free-pool>10</initial-beans-in-free-pool>

<max-beans-in-free-pool>100</max-beans-in-free-pool>

</pool>

<destination-jndi-name>ExtSystemSenderQueue2</destination-jndi-name>

<connection-factory-jndi-name>ExtSystemSenderQCF2</connection-factory-jndi-name>

<jms-polling-interval-seconds>1</jms-polling-interval-seconds>

</message-driven-descriptor>

<jndi-name>ExtSystemSenderQueue2</jndi-name>

<transaction-descriptor>

<trans-timeout-seconds>60</trans-timeout-seconds>

</transaction-descriptor>

</weblogic-enterprise-bean>

 

Note: <destination-jndi-name> i.e. JNDI name of the JMS sender queue should be same as given while creating the queue. In above example it is- ExtSystemSenderQueue2.

<connection-facory-jndi-name> i.e. connection factory JNDI name should be same as given while creating the new connection factory. In the above example it is- ExtSystemSenderQCF2.

<dispatch-policy> value should be same for all the Entities. i.e., ExtxfaceWorkManager

After Redeploying the ExtxfaceSimulatorMDB and restarting the server, check the state of the application by going in Deployments wizard on the weblogic server console. If it is not in “Active” state, it needs to be started manually, to do so, follow the steps mentioned below by keeping server in ‘Running’ state-

Back