Set - 2

Question 1 :

What is the difference between Message producer and Message consumer?

Answer :

Answer 1:
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.

Answer 2:
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.

Answer 3:
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.


Question 2 :

What is JMS application ?

Answer :

One or more JMS clients that exchange messages.


Question 3 :

What type messaging is provided by JMS ?

Answer :

Both synchronous and asynchronous are provided by JMS.


Question 4 :

How JMS is different from RPC?

Answer :

In RPC the method invoker waits for the method to finish execution and return the control back to the invoker. Thus it is completely synchronous in nature. While in JMS the message sender just sends the message to the destination and continues it's own processing. The sender does not wait for the receiver to respond. This is asynchronous behavior.


Question 5 :

What Is the JMS API?

Answer :

The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. Designed by Sun and several partner companies, the JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.
The JMS API minimizes the set of concepts a programmer must learn to use messaging products but provides enough features to support sophisticated messaging applications. It also strives to maximize the portability of JMS applications across JMS providers in the same messaging domain.
The JMS API enables communication that is not only loosely coupled but also
* Asynchronous. A JMS provider can deliver messages to a client as they arrive; a client does not have to request messages in order to receive them.
* Reliable. The JMS API can ensure that a message is delivered once and only once. Lower levels of reliability are available for applications that can afford to miss messages or to receive duplicate messages.
The JMS Specification was first published in August 1998. The latest version of the JMS Specification is Version 1.1, which was released in April 2002. You can download a copy of the Specification from the JMS Web site, http://java.sun.com/products/jms/.