Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Weblogic Server
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

Purpose:

This article shows the steps to create a simple JMS queue in WebLogic Server for testing purposes.

 

Introduction & Definitions

Messaging is a method of communicating between software components or applications. Messaging allows loosely-
coupled communication between distributed applications. Message clients can send and receive messages by
connecting to a messaging agent that facilitates message receipt and delivery. Clients need not know anything
about other clients that will consume or produce messages. A message client only needs to know the format of
the message to send and the destination. Thus messaging differs from other tightly coupled technologies, such
as Remote Method Invocation (RMI), which require an application to know a remote applications methods.

The Java Message Service API was designed by Sun Microsystems and several other companies to address the need
to connect intra-company applications through enterprise messaging products, sometimes referred to as Message
Oriented Middleware (MOM). JMS provides a way for Java applications to access messaging systems. JMS is a set
of interfaces and associated semantics that defines how a JMS client access the facilities of messaging
implementation. In this regard JMS is very much like JDBC.
Messaging systems are peer-to-peer facilities, allowing clients to send and receive messages from any other
client. Some messaging systems can also broadcast messages to many destinations, and clients subscribe to a
specific channel or topic to receive messages from that are broadcast. JMS is implemented to support both
models, depending upon the implementation of the JMS provider. The figure below illustrates the participating
components of a Java Message Service implementation.

 

a0.1

 

The JMS API Messaging System Participants

A JMS technology provider (JMS provider) is a messaging system that provides an implementation of the JMS API.
For an application server to support JMS technology, you must place the administered objects (connection
factories, queue destinations, and topic destinations) in the JNDI technology namespace of the application
server. Typically, you would use the administrative tool supplied by the application server to perform this
task. However, in this tutorial, you will use the capabilities built into NetBeans to define and create the
administered objects.

Specifically, you will define a Queue Destination and Connection Factory in NetBeans. After deploying the
application once, you can use a feature in NetBeans to generate the code that uses the Connection Factory you
specified to generate a Connection object. With the Connection object, the generated code creates a Session
object, which is used to create a MessageProducer object to send the string entered on JSF page to the queue as
a Message object


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

 

What is a JMS Application?
A JMS application is composed of the following parts:
• JMS Clients - These are the Java language programs that send and receive
messages.
• Non-JMS Clients - These are clients that use a message system’s native client
API instead of JMS. If the application predated the availability of JMS it is
likely that it will include both JMS and non-JMS clients.
• Messages - Each application defines a set of messages that are used to
communicate information between its clients.
• JMS Provider - This is a messaging system that implements JMS in addition
to the other administrative and control functionality required of a fullfeatured
messaging product.
• Administered Objects - Administered objects are preconfigured JMS objects
created by an administrator for the use of clients.


Creating JMS  in WLS

1.Configuration Steps
1. Go To Services > Messaging > JMS Server

2.Click on New button to create the new JMS Server. Let's suppose we name it JMSServer-ms1.

3.Create a JMS Module

-->Click on JMS module to create a new Module for JMS. 
Services > Messaging > JMS Modules
Select New
Name: jms-system-mod-ms1
Leave the other options empty
Targets: ms1 (or choose the same one as the JMS server)
Press Next
Leave “Would you like to add resources to this JMS system module” unchecked and press Finish.

After creating module click on the module created 

 

4.Create the Connection Factory by choosing Connection Factory option.

 

--> Choose the server to be targeted and click on Finish. In our case, we will select managed server ms1.

4.Click on New to create Queue.

 

--> Select the Queue option>Next

--> Enter Name: q1
JNDI Name : q1
Template : None
Press Next

--> Select the sub-deployment if available or create a new one by pressing Create a new Subdeployment button
and press Finish button.

a8

a9

 

If you want to check where the JMS server is targeted click on JMS Server, you will find ms1 is its
target 

--> Click on JNDI tree structure to see the queue and connection factory. JNDI tree structure>ms1>q1

Class will let you know whether it's a queue or connection factory.

 

Now the configuration for JMS is done. 

 

A brief look at What all is Needed for a JMS Infra.


1. You need to have a Web Logic Server( Managed Server)
2. You need a persistent store
3. You need a JMS Server which is targeted to the managed server and server and use the persistent store.
4. You need a JMS Module
5. In this JMS Module you need a sub-deployment which is targeted to the JMS server.
6. Within the JMS module you need a connection factory which should be targeted to the Managed Server.
7. Within the JMS Module you need a Queue which is targeted to the sub deployment.

JMS SERVER uses the file-store-ms1, which is the file or database in which the JMS persistent messages are
stored .

You can create a file store by Selecting Persistent Stores (under Domain Structure) & Pressing New Button.

 

 

The file store is a .dat file in which all the messages will be stored once acknowledged. 

a15

So our JMS infra is ready for communication. 

 

 


Kashif Baksh

Add comment


Security code
Refresh

About the Author

Kashif Baksh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  May 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
    1  2  3  4  5
  6  7  8  9101112
13141516171819
20212223242526
2728293031  

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner