Categories: Mule 4Mulesoft

JMS Messaging Pattern in MuleSoft

JMS messaging pattern is widely used for asynchronous communication. JMS is introduced between the Source and Target systems and the communication happen through messaging only. Systems are loosely coupled and they really don’t aware of each other. Source system can send the message to JMS without having knowledge of Target system.

Advantage of having JMS pattern

  • Loosely coupled
  • Asynchronous – Receiver will get the message as soon as it arrives on the JMS. Receiver don’t have to check the JMS on regular intervals.
  • Reliable – JMS ensure/guarantee the delivery of messages and that to only once.

JMS pattern again can have two categories

  • Queue (Point To Point pattern)
  • Topic (Publisher Subscriber pattern)
Point to Point JMS pattern

Point to Point JMS pattern uses JMS Queue for communication. Here we can have one or multiple senders and only one receiver.

Point to remember

  • P2P JMS use Queue for communication
  • JMS sender/senders can send the message to queue without having knowledge of receiver
  • JMS receiver will receive the message as and when it arrive on JMS queue
  • There is no time dependency for the message to be consumed and can reside on the queue for long as per the Queue configuration
  • JMS queue will store the message till the time it’s not consumed by the receiver. In case the JMS application restart then also message will not lost
Publisher Subscriber JMS pattern

Publisher Subscriber JMS pattern use JMS Topic for communication. Here we can have multiple publishers and subscribers. Copy of message is send to all the subscribers.

Point to remember

  • Pub/Sub use JMS topic instead of queue
  • Publishers can send the message to Topic and copy of message will be received by all the subscriber
  • There is a time associated with the message where all subscriber should get the message before the time expired otherwise the message is not sent to the subscriber after time delay
  • Topic doesn’t store the message for long

More information – https://docs.mulesoft.com/jms-connector/1.7/jms-topic-subscription

Note: Also read about C Program – Structure & Keywords in C.

Follow Me

If you like my post please follow me to read my latest post on programming and technology.

https://www.instagram.com/coderz.py/

https://www.facebook.com/coderz.py

Recent Posts

Generate Parenthesis | Intuition + Code | Recursion Tree | Backtracking | Java

Problem Statement: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example…

2 months ago

Square Root of Integer

Given an integer A. Compute and return the square root of A. If A is…

1 year ago

Build Array From Permutation

Given a zero-based permutation nums (0-indexed), build an array ans of the same length where…

1 year ago

DSA: Heap

A heap is a specialized tree-based data structure that satisfies the heap property. It is…

1 year ago

DSA: Trie

What is a Trie in DSA? A trie, often known as a prefix tree, is…

1 year ago

Trees: Lowest Common Ancestor

What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of…

1 year ago