Showing posts with label Queues. Show all posts
Showing posts with label Queues. Show all posts

Working with JMS Palettes In TibcoBW Process

Here, I would brief on JMS palettes used for connecting to Queues and Topics. Queues are for point-to-point communication model and Topics are for Publish and Subscribe model.
Lets first create a JMS connections using JMS Connection as shown below.
In JMS connection, configure the appropriate username and password details and then test connection to verify the connectivity.
Create a new process and drag and drop a JMS Queue Sender activity from JMS Palette. Lets send a simple text information to queue by passing a text data in JMS body as shown.
Configure the JMS connections and destination queue name in the configuration tab of JMS Queue Sender. Choose message type as text, as we are sending text messages to the queue.
Lets build another process that receives the message from the queue and logs the message. Bring a JMS Queue Receiver activity from JMS palette. This a starter activity.
In JMS Queue Receiver, configure the connection and destination queue. Mapping of JMS Queue receiver to WriteToLog is shown below.
From tester tab, run the process and Create a job for sender and immediate you notice, JMS queue receiver processes the message from queue.
Lets now, develop a publisher and subscriber process with JMS Topic Publisher and Subscriber. Create new publisher process, as shown below.
Here is the subscriber process, which receives the message and logs it using WriteToLog. Similarly, there is another subscriber process having same functionality.
Run and test the process. For every instance of publisher,two subscribers A and B are initiated as shown below.
Now, we will build process using JMS Requestor activity, activity can be used to both Topics and Queues activities.
Below screen shots show a processing invoking JMS Queue Requestor activity and there is implementation for using JMS Queue Receiver and Reply to JMS Message.
Run and verify the process as shown below.
Similar to queue requestor, below screen shot shows the topic requestor implementation.
The video demonstration is available on the Youtube, here is the embedded video.



Connecting to Tibco EMS in Mule using JMS Connector


In this article, I will brief about messaging interfaces using JMS connector in Mule. We will be connecting to Tibco EMS Server.

Queues and Topics:

  • Point-to-Point(Queues): Message delivered to one recipient.
  • Publish Subscribe(topics): Message delivered to multiple recipients. 
Let create a new mule project and add the following references to the projects as shown below.
Lets not  create a simple flow to read a message from the queue and write it to file system. Drag and drop the JMS connector and then file activity as shown and then configure the JMS connector as shown below,
Configure the connector configurations as shown below,
Configure the JMS to poll message from queue and then file activity as shown; Run the mule app to verify the behavior. Make sure Tibco EMS Server is up and running.
Using GEMS tools, we would connect to the EMS server and then push a message to tibcodj.queue as shown.
Once the message is available in the queue, as the mule flow is polling to the same queue, this message would be picked up and sent to file system.
This flow would pick up all the message that arrives at this queue. Lets add a JMS filter to select a type of message based on the specific property of the message. From GEMS tool, lets a custom property to the message as shown below, we add a ServiceType Property and provide as Cab.
In the message flow, go to the configuration tab and add JMS Selector filter as shown and run the project to verify the behavior.
Now lets connect to a Topics using JMS connector, as earlier we would configure another JMS connector to connect to Topic.

Here is the simple, which polls on a file directory and then push the text available in the file to a EMS topic. Flow configurations are shown below,
Run the project and push a message from GEMS to a queue,
1st flow would create a dat file in the directory and as 2nd flows polls this same directory the information in file is picked up and processed to the Tibco EMS topic, as  shown below.
Now lets try to add a subscriber flow, as shown
Now in the 2nd flow i.e topic publisher lets add a message property to message using message properties and sends to the EMS topic and the subscriber i.e 3 flow, subscribes to message based on the property value as shown below,