JAVA MESSAGE SERVICE – JMS
Techno Kryon |
JMS Introduction:-
Java
Message Service (JMS) is an Application Programming Interface (API) that
provides the facility to create, send, receive and read messages.
Java Message service provides
asynchronous communication, loosely coupled and reliable. It is also known as
messaging service in java.
The Java Message Service (JMS) API is a message-oriented
middleware API for sending messages
between two or more clients. JMS is
mainly used for sending and receiving a message from one application to another
application.
JMS is a part of the Java
Platform, Java Enterprise Edition developed at Sun Microsystems, but which
has been guided by the Java Community Process.
JMS Messaging Domains:-
Java Message Service has two types of
messaging domains.
·
Point-to-Point Messaging Domain
·
Publisher/Subscriber Messaging Domain
Point-to-Point
Messaging Domain:-
In PTP, messages are delivered to individual consumers (only one receiving
consumer) and who maintain Queues of
incoming message system. This PTP messaging Concept implements for message
Queues, senders and receivers. It is also Works as First in First out (FIFO)
like a stack.
In PTP, any number of message or
producers can send messages to the queue, each message delivered to only one
consumer and each message is guaranteed to be delivered. Queues retain
all messages sent to them until the messages expire or consumed. If no
consumers are registered to deliver the messages, the queue waits for them
until a consumer registered and message delivered to the registered consumer.
There is no time dependency between consumer and Publisher/Subscriber and also receiver acknowledged the consumption on each message in
JMS.
Publisher/Subscriber Messaging
Domain:-
Publish-Subscribe
messaging model, one message is
delivered to all subscribers like broadcasting message technique. In this model, Topic is used as a Java message-oriented middle ware that is responsible
to wait and delivered the messages to subscribers.
·
Zero
or more consumers will receive the message in this publisher messaging domain.
·
There
is a timing dependency between Sender and Receiver. The publisher has created the
message topic for clients to subscribe. The subscriber must remain active continuously
to receive messages unless it has established a durable time.
Applications do not need to be on the same server because of
loosely coupled. Message communication
techniques are handled by the message broker, it is called a topic and each message is guaranteed to be delivered and each receiver acknowledged
the consumption of each message in JMS.
A message can have delivery to multiple consumers and
consumers will get the messages after consumers get subscribed and consumers
need to wait for continuously in order to get new messages.
Advantage for JMS:-
·
Asynchronous
Communication - JMS of
point-to-point messaging domain queue provides high throughput, high
performance due to asynchronous behavior. JMS has the
capability to send thousands of messages within a second to concurrent
consumers using multiple threads and processes.
·
Reliability – Message sent will surely to be delivered for
consumers without any loss of data. Also, the message will be sent only once in
JMS.
·
Load
Balancing – When there is increase the load
in JMS. The lots of messages are received by consumers, and then the JMS does
efficient load balancing by having a pool of message processors.
Comments
Post a Comment