Search Tutorials

Top JMS (2023) frequently asked interview questions | JavaInUse

Top JMS (Java Messaging Service) Interview Questions

In this post we will look at JMS Interview questions. Examples are provided with explanation.

Q: What is JMS(Java Messaging Service)?
Java Message Service (JMS) is an application program interface (API) from Sun Microsystems that supports the formal communication known as messaging between computers in a network. Sun's JMS provides a common interface to standard messaging protocols and also to special messaging services in support of Java programs. Sun advocates the use of the Java Message Service for anyone developing Java applications, which can be run from any major operating system platform.

Q: What are components of JMS?
The components of JMS are as follows-
  • JMS Provider
    A messaging system that implements the JMS interfaces and provides administrative and control features.
  • Clients
    Java applications that send or receive JMS messages. A message sender is called the Producer, and the recipient is called a Consumer
  • Messages
    Objects that communicate information between JMS clients.
  • Administered objects
    Preconfigured JMS objects created by an administrator for the use of clients.

Q: What type of Messaging is provided by JMS?
JMS provides both synchronous and asynchronous messaging

Q: Explain synchronous messaging in JMS?
Synchronous messaging describes communications that takes place between two applications or systems, where the system places a message in a message queue (also called an Event Queue in enterprise messaging systems) and then waits for a message response before it continues processing.

Q: What is difference between queue and topic in jms?
Queue is JMS managed object used for holding messages waiting for subscribers to consume. When all subscribers consumed the message , message will be removed from queue. Topic is that all subscribers to a topic receive the same message when the message is published.

Q: What are the different JMS Providers?
There are several JMS providers available like Apache ActiveMQ and OpenMQ.
Top ActiveMQ Interview Questions
Getting Started with JMS Messaging- ActiveMQ Hello World Tutorial

See Also

Spring Batch Interview Questions Apache Camel Interview Questions JBoss Fuse Interview Questions Drools Interview Questions Java 8 Interview Questions