DEVFYI - Developer Resource - FYI

What is the difference between Message producer and Message consumer?

JMS Interview Questions and Answers


(Continued from previous question...)

23. What is the difference between Message producer and Message consumer?

A1:
Messaging systems provide a host of powerful advantages over other conventional distributed computing models. Primarily, they encourage "loose coupling" between message consumers and message producers. There is a high degree of anonymity between producer and consumer: to the message consumer, it doesn't matter who produced the message, where the producer lives on the network, or when the message was produced.

A2:
In Publish/Subscribe model:
A publish/subscribe (pub/sub) messaging system supports an event driven model where information consumers and producers participate in the transmission of messages. Producers "publish" events, while consumers "subscribe" to events of interest, and consume the events. Producers associate messages with a specific topic, and the messaging system routes messages to consumers based on the topics the consumers register interest in.
In Point-To-Point model:
In point to point messaging systems, messages are routed to an individual consumer which maintains a queue of "incoming" messages. Messaging applications send messages to a specified queue, and clients retrieve messages from a queue.

A3:
In Point-To-Point model, one client can send message to the another client through the Destination.
There is a guarantee to recieve the message whenever reciever is connected.
example:your telephone answering machine ,outer send a message to u,but you can recieve those msg whenever u coonected to answering machine.
In pub/sub model. one publisher,many no.of clients willbe there,publisher publish the message,subscriber or consumer can recieve those messages when he got subscription through the topic.There is no guarantee consumer can recieve the messages send by the publisher.

(Continued on next question...)

Other Interview Questions