Integration / ActiveMQ Interview Questions Basics
1. What is ActiveMQ?
Apache ActiveMQ is an open-source message broker written in Java that implements the JMS (Java Message Service) specification. It lets independent applications exchange data asynchronously by sending messages through queues or topics instead of calling each other directly. Because the broker sits...
2. What is JMS (Java Message Service)?
JMS is a Java API specification, not a product, that defines a standard way for Java applications to create, send, receive, and read messages. It describes interfaces such as ConnectionFactory, Destination, Session, and MessageProducer/Consumer that any compliant broker must support. ActiveMQ, Ar...
3. What are the types of messaging models in JMS?
JMS defines two core messaging models that determine how a message travels from sender to receiver. Point-to-Point - messages are placed on a queue and delivered to exactly one consumer. Publish-Subscribe - messages are sent to a topic and delivered to every active subscriber. Both models share t...
4. What is a message broker?
A message broker is a middleware server that receives messages from producers, stores them temporarily, and routes them to the correct consumers. It handles concerns like message persistence, delivery guarantees, retry logic, and protocol translation so applications on either end don't have to im...
5. What is a Queue in ActiveMQ?
A Queue is a destination used for point-to-point messaging: each message placed on the queue is delivered to and consumed by exactly one receiver, even if several consumers are listening. Once a consumer acknowledges the message, it is removed from the queue. Queues are typically used for work-di...
6. What is a Topic in ActiveMQ?
A Topic is ActiveMQ's publish-subscribe destination: a message sent to a topic is delivered to every consumer currently subscribed to it. If no subscribers are listening at the time, non-durable subscribers simply miss the message. Topics fit fan-out scenarios such as broadcasting price updates o...
7. What are the main components of ActiveMQ architecture?
The core building blocks of an ActiveMQ deployment are: Broker - the server process that accepts connections and routes messages. Producer - client that sends messages to a destination. Consumer - client that receives messages from a destination. Destination - a Queue or Topic that messages are a...
8. What is the purpose of a Connection Factory in ActiveMQ?
A ConnectionFactory is the JMS object a client uses to create a Connection to the broker. It encapsulates the broker URL, and often credentials and failover settings, so application code doesn't hard-code connection details. Instead of establishing a socket manually, a client looks up or instanti...
9. Define a Producer in ActiveMQ?
A Producer (MessageProducer in JMS terms) is the client component responsible for creating and sending messages to a specific destination, either a Queue or a Topic. It is created from a Session and can set delivery mode, priority, and time-to-live per message. A producer doesn't need to know who...
10. Define a Consumer in ActiveMQ?
A Consumer (MessageConsumer) is the client that receives messages from a Queue or Topic. It can pull messages synchronously via receive() , or process them asynchronously through a registered MessageListener callback. Consumers are also responsible for acknowledging messages according to the sess...
11. What is a Durable Subscriber in ActiveMQ?
A Durable Subscriber is a Topic consumer that registers with a unique client ID and subscription name so the broker retains messages for it even while it is disconnected. Regular topic subscribers only receive messages published while they are actively connected; a durable subscriber, by contrast...
12. What are the transport protocols supported by ActiveMQ?
ActiveMQ supports several wire protocols depending on client type and use case: Protocol Typical Use OpenWire Native, high-performance Java clients STOMP Simple text-based, cross-language messaging MQTT Lightweight IoT and mobile devices AMQP Interoperability with other brokers REST / WS HTTP-bas...
13. What is the OpenWire protocol?
OpenWire is ActiveMQ's native, binary wire protocol optimized for Java clients. It's the default transport when connecting via the standard tcp:// URL and generally offers lower overhead than text-based protocols like STOMP because it encodes JMS objects directly rather than serializing to text. ...
14. What is the ActiveMQ web console used for?
The ActiveMQ web console is a browser-based admin UI, typically at http://localhost:8161/admin , that lets an operator inspect queues and topics, view pending message counts, browse message contents, purge destinations, and monitor connected consumers/producers in real time. It's handy for quick ...
15. How do you install ActiveMQ locally?
Download the binary distribution, extract it, and start the broker from its bin directory: tar -xzf apache-activemq-5.18.0-bin.tar.gz cd apache-activemq-5.18.0 bin/activemq start Use bin/activemq console instead to run it in the foreground for debugging. Then confirm it's up by hitting the web co...
16. List the message acknowledgment modes in ActiveMQ?
JMS sessions in ActiveMQ support four acknowledgment modes: AUTO_ACKNOWLEDGE - acknowledged automatically right after the message is received. CLIENT_ACKNOWLEDGE - the client explicitly calls acknowledge() . DUPS_OK_ACKNOWLEDGE - lazy acknowledgment that tolerates occasional duplicates for better...
17. What is a Dead Letter Queue in ActiveMQ?
A Dead Letter Queue (DLQ) is a special destination, ActiveMQ.DLQ by default, where messages land after they exceed their configured redelivery attempts or expire without being successfully processed. Instead of silently dropping a poisoned message, the broker moves it aside so an operator or a de...
18. What are Virtual Destinations in ActiveMQ?
Virtual Destinations let ActiveMQ blend queue and topic semantics. A Virtual Topic lets multiple durable, queue-backed consumer groups each get their own copy of every message, combining topic fan-out with queue-style load balancing per group. A Composite Destination lets one send target fan out ...