Sunday, September 10, 2023

JMS Messages using Queues

In this tutorial, I will explain how to send and receive JMS messages to/from Queues.

EMS -  Enterprise Message Service, which's implemented by using Java Message Service (JMS) to integrate the applications. EMS acts as a Message-oriented-middleware (MOM) and creates a common communication protocol between applications and allows us to easily integrate new and existing applications.

The EMS supports Point-to-Point & Publish-and-Subscribe messaging models. The objects which we used for these messaging models are queues and topics.

Point-to-Point - Queue

Point-to-point messaging queues and will have one producer and one consumer per message. The queue will store messages until they are received by a consumer (Persistent). More than one producer can send messages to queue and more than one consumer can receive messages from the same queue.

Publish-and-Subscribe - Topic

A publisher can send a message to a single topic and can be received by many subscribers. Many publishers can publish the messages on the same topic. In this model, the topic won’t store the messages. Only the subscriber was listening to the topic when the publisher sends the message will get it.

Start EMS server

Go to Windows>Run>services.msc

And start it

Open  EMS Admin Tool

This CLI is used to create queues/topics and manage them.


Optionally, you can use Gems tool to manage Queues/Topics - Its a GUI tool.


Next, create a simple process to send message to Queue.
Create a JMS connection, use Global Variables in real-time and specify JNDI connection details appropriately and test it.

Publisher Sample Process:

Specify JMS connection, Destination Queue and message type as per your setup.
In real time, queues will be created by Tibco Admin team.

Go to advanced Tab and specify Delivery Mode - PERSISTENT, NON-PERSISTENT, TIBCO EMS RELIABLE DELIVERY
If you need more details, please go through Tibco documentation.

Input Tab:
Map / Specify inputs to JMS Message>Body

That's all for Queue Sender Part.

                                                            *******************************
Next, I will build a simple process for Queue Receiver part.

JMS Queue Receiver
Acknowledge Mode:

Log


That's it.

Now, test the Sender process and Receiver process and see the results.


Check EMS Admin tool also..

Pending Msgs: 0 (No pending messages, delivered successfully)
Delivered Msgs : 0 (How many delivered so far)

For more info, please feel free to go thru TIBCO documentation.

Thanks for reading :-)








No comments:

Post a Comment

XML Palette Activities

The XML palette provides activities for parsing XML strings into schemas and rendering schemas into XML strings Parse XML: Parse XML  is use...