JMS Interview Questions


Question: What is point-to-point messaging?
 Question: Can two different JMS services talk to each other? For instance, if A and B are two different JMS providers, can Provider A send messages directly to Provider B? If not, then can a subscriber to Provider A act as a publisher to Provider B?  
Question:  What is the advantage of persistent message delivery compared to nonpersistent delivery?
Question:  Give an example of using the publish/subscribe model.  
Question:  Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?
Question:  What are the various message types supported by JMS?
Question:  How is a java object message delivered to a non-java Client?
Question: What is MDB and What is the special feature of that?
Question:  What are the types of messaging?
Question:  What are the core JMS-related objects required for each JMS-enabled application?

Q:

What is point-to-point messaging?

A: With point-to-point message passing the sending application/client establishes a named message queue in the JMS broker/server and sends messages to this queue. The receiving client registers with the broker to receive messages posted to this queue. There is a one-to-one relationship between the sending and receiving clients.
 
[ Received from Prasanna Inamanamelluri ]

Q:

Can two different JMS services talk to each other? For instance, if A and B are two different JMS providers, can Provider A send messages directly to Provider B? If not, then can a subscriber to Provider A act as a publisher to Provider B?

A: The answers are no to the first question and yes to the second. The JMS specification does not require that one JMS provider be able to send messages directly to another provider. However, the specification does require that a JMS client must be able to accept a message created by a different JMS provider, so a message received by a subscriber to Provider A can then be published to Provider B. One caveat is that the publisher to Provider B is not required to handle a JMSReplyTo header that refers to a destination that is specific to Provider A.
 
[ Received from Prasanna Inamanamelluri]

Q:

What is the advantage of persistent message delivery compared to nonpersistent delivery?

A: If the JMS server experiences a failure, for example, a power outage, any message that it is holding in primary storage potentially could be lost. With persistent storage, the JMS server logs every message to secondary storage. (The logging occurs on the front end, that is, as part of handling the send operation from the message producing client.) The logged message is removed from secondary storage only after it has been successfully delivered to all consuming clients .  
 
[ Received from Prasanna Inamanamelluri]

Q:

Give an example of using the publish/subscribe model.

A: JMS can be used to broadcast shutdown messages to clients connected to the Weblogic server on a module wise basis. If an application has six modules, each module behaves like a subscriber to a named topic on the server.
 
[ Received from Prasanna Inamanamelluri]

Q:

Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?

A: Some messaging systems provide synchronous delivery to destinations as a mechanism for implementing reliable applications. Some systems provide clients with various forms of delivery notification so that the clients can detect dropped or ignored messages. This is not the model defined by the JMS API.

JMS API messaging provides guaranteed delivery via the once-and-only-once delivery semantics of PERSISTENT messages. In addition, message consumers can ensure reliable processing of messages by using either CLIENT_ACKNOWLEDGE mode or transacted sessions. This achieves reliable delivery with minimum synchronization and is the enterprise messaging model most vendors and developers prefer.

The JMS API does not define a schema of systems messages (such as delivery notifications). If an application requires acknowledgment of message receipt, it can define an application-level acknowledgment message.
 
 
Received from Prasanna Inamanamelluri]

Q:

What are the various message types supported by JMS?

A: Stream Messages ? Group of Java Primitives
Map Messages ? Name Value Pairs. Name being a string& Value being a java primitive
Text Messages ? String messages (since being widely used a separate messaging Type has been supported)
Object Messages ? Group of serialize able java object
Bytes Message ? Stream of uninterrupted bytes
 
[ Received from Prasanna Inamanamelluri]

Q:

How is a java object message delivered to a non-java Client?

A: It is according to the specification that the message sent should be received in the same format. A non-java client cannot receive a message in the form of java object. The provider in between handles the conversion of the data type and the message is transferred to the other end.
 
[ Received from Prasanna Inamanamelluri]

Q:

What is MDB and What is the special feature of that?

A: MDB is Message driven bean, which very much resembles the Stateless session bean. The incoming and out going messages can be handled by the Message driven bean. The ability to communicate asynchronously is the special feature about the Message driven bean.
 
[ Received from Prasanna Inamanamelluri]

Q:

What are the types of messaging?

A: There are two kinds of Messaging.
Synchronous Messaging: Synchronous messaging involves a client that waits for the server to respond to a message.
Asynchronous Messaging: Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server.
 
[ Received from Prasanna Inamanamelluri]

Q:

What are the core JMS-related objects required for each JMS-enabled application?

A: : Each JMS-enabled client must establish the following:
A connection object provided by the JMS server (the message broker)
Within a connection, one or more sessions, which provide a context for message sending and receiving
Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker
Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively)
Within a session, a message object (to send or to receive)
.
 
[ Received from Prasanna Inamanamelluri]




JMS Interview Questions

Similar Topics
Forum For Java Interview Questions new

Java Interview Questions
Java Collection Interview Questions
JSP Interview Questions
Servlet Interview Questions
EJB Interview Questions
JMS Interview Questions
Struts Interview Questions
Spring Interview Questions
WMB Interview Questions
DB Interview Questions

Use of this website constitutes acceptance of the AllAppLabs.com Terms and Conditions