Tuesday, July 31, 2007

JAVA JNDI JMS Interview questions

JNDI, JMS INTERVIEW QUESTIONS

Question: What is messaging?
Answer: Messaging is a mechanism by which data can be passed from one application to another application.
Question: What is point-to-point messaging?
Answer: With point-to-point message passing t

Question: What is point-to-point messaging?
Answer: 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.

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?

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

Question: What is the advantage of persistent message delivery compared to nonpersistent delivery?
Answer: 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

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

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


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

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

Question: Give an example of using the publish/subscribe model.

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

Question: What is the difference between the Mailing and Messaging?

Answer: Java Mailing is the set of APIs that primarily concerns with the sending of Mail messages through the standard mail protocols. Messaging is the way of communicating to the remote machines using Message Oriented Middlewares. Message Oriented Middlewares do not use mailing internally for communication. They create their own channels for communication.