JMS Interview Questions

What is JMS?
JMS is an acronym used for Java Messaging Service. It is Java’s answer to creating software using asynchronous messaging. It is one of the official specifications of

the J2EE technologies and is a key technology.

How JMS is different from RPC?

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. 

What are the advantages of JMS?

JMS is asynchronous in nature. Thus not all the pieces need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM

will store the messages on it’s behalf and will send them once it comes back up. Thus at least a part of application can still function as there is no blocking.
Are you aware of any major JMS products available in the market?
IBM’s MQ Series is one of the most popular product used as Message Oriented Middleware. Some of the other products are SonicMQ, iBus etc.All the J2EE

compliant application servers come built with thier own implementation of JMS.

What are the different types of messages available in the JMS API?

Message, TextMessage, BytesMessage, StreamMessage, ObjectMessage, MapMessage are the different messages available in the JMS API.

What are the different messaging paradigms JMS supports?

Publish and Subscribe i.e. pub/suc and Point to Point i.e. p2p.

What is the difference between ic and queue?

A ic is typically used for one to many messaging i.e. it supports publish subscribe model of messaging. While queue is used for one-to-one messaging i.e. it supports

Point to Point Messaging.