ActiveMQ Interview Questions

ActiveMQ Interview Questions | Freshers & Experienced

  • Subrata Dutta
  • 12th Apr, 2021
  • 878 Followers

Key Features of Activemq

Below are few major features of Activemq

Real Time Broadcasting

Enterprise Integration Patterns

JMX Support

Command line interface

AMQ Message Store

Command Agent

Message Transformation

Mirrored Queues

Producer Flow Control

ActiveMQ Interview Questions

Q1. Explain what Activemq is?

It is basically known as the Active Message queuing (ActiveMQ). So here it is a way to communicate between two applications. It allows send to message and the messages are also held in a queue. It is written in Java and it allows us to connect the sender and the receiver. Here the community between the applications can be continued between a client and the server even when one of the applications is not working.

Q2. List the platforms supported by ActiveMQ?

Platforms supported by ActiveMQ:

Operating systems

  • Windows: Windows XP SP2, Windows 2000.
  • Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.

Environment Supports

  • For deployment JDK 1.7.x or greater and 1.7.x (Java 7) for compiling/building.
  • The JAVA_HOME environment variable must be set to the directory where the JDK is installed e.g., c:\Program Files\jdk.1.7.0_xx_xx.
  • Maven 3.0 or greater
  • Required JARs must be added to the classpath.

Q3. What is difference between ActiveMQ and Mule?

As we have previously mentioned, ActiveMQ is a message broker that implements the JMS API. It is used to implement listeners and subscribers to respond to queue events. It also has features such as high-availability of data and message load balancing feature. Whereas, Mule is an open-source Enterprise service bus.

This Enterprise Service Bus has capabilities beyond the JMS like message transformation, routing, logging, security, etc.

Q4. How to integrate ActiveMQ with Apache Camel?

As we know ActiveMQ is an opensource JMS provider that allows communication between two different applications. Apache Camel comes with a JMS provider. So to integrate ActiveMQ with Apache Camel we need to configure it by adding the following jars in your project.

<bean id = "jms" class = "org.apache.camel.component.jms.JmsComponent"><property name = "connectionFactory"><bean class="org.apache.activemq.ActiveMQConnectionFactory"><property name = "orderQueue" value = "tcp://localhost:61000" /></bean></property></bean>

Q5. What is Activemq default port?

The default port of ActiveMQ is 8161. You can change it by editing activemq.xml file

Q6. What is JMX?

JMS (Java Management Extensions) is a JAVA library that provides tools to manage and monitor applications, system objects, devices, and service-oriented networks. It was first introduced in J2SE 5.0 release.

Q7. How to configure JMX for ActiveMQ remoting access?

Q8. For What is ActiveMQ is used?

ActiveMQ is free and an open-source message broker protocol developed by Apache Software Foundation. It is mainly used to communicate between two distributed processes/applications. It also supports services like STOMP, JMS, and OpenWire.

Q9. How to check the status of an ActiveMQ broker?

You can check the status of an ActiveMQ broker it is running or not by sending a test message to the broker if you receive a message back that means the broker is running and everything is fine.

Use the below code to check the ActiveMQ broker status.

try {
    ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
    Connection conn = factory.createConnection(user, password);
    Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer("test");
    MessageConsumer consumer = session.createConsumer("test");
    consumer.setMessageListener(this); // class that implements MessageListener
    conn.start();
    TextMessage message = new ActiveMQTextMessage();
    message.setText("TestMessage");
    producer.send(message);
} catch (JMSException e) {
    // somethings got wrong
}

Q10. List few differences between Apache kafka vs ActiveMQ?

Differences between Apache Kafka and ActiveMQ

APACHE KAFKA

  • It provides distributed horizontal streaming capabilities which makes it a distributed streaming platform.
  • It let the applications to process and re-process streamed data on the disk.
  • It is widely used for real-time data streaming because of its high throughput.

ACTIVEMQ

  • It Is useful for integration between services/applications mainly in a Service-oriented architecture.
  • It is a general-purpose message broker that supports various messaging protocols like AMQP, STOMP, MQTT.
  • It allows for more complicating message routing and enterprise integration patterns.
  • It is based on JMS specifications.

Q11. What is difference between Pending Messages and Enqueue Counter in Active MQ?

Q12. How to set up Monitoring for queue in ActiveMQ?

Q13. How can I change default port number of Activemq?

The default port of ActiveMQ is 8161. You can change it by editing your activemq.xml file.

  • Open activemq.xml file
  • Find 8161 and replace it with the new port no you want to use.

Q14. What message storage is the best to use for ActiveMQ?

KahaDB is fastest and best message storage to use for ActiveMQ. KahaDB is a file-based message store that combines the transactional journal for very reliable message storage and recovery with good performance and scalability.

Q15. Enlist the protocols supported By ActiveMQ

ActiveMQ supports MQP, MQTT, OpenWire and STOMP protocols which are used by applications in different programming languages.

Q16. How to start ActiveMQ server?

Below are steps to start ActiveMQ server

  • Step 1: Cd to the bin folder of your ActiveMQ installation.
  • Step 2: Run activemq start the command to start the server.

Q17. What is difference between JMS and ActiveMQ?

ActiveMQ is a message brokering service that implements JMS API and supports other cross-language clients and protocols. With ActiveMQ, you can implement queues or topis and write subscribers or listeners to respond to the queue events. JMS is a Java-based messaging protocol specification that is fundamental to other technologies.

The difference between them is that ActiveMQ is an implementation of the JMS (Java Messaging Service) and JMS is just a protocol specification.

Q18. What is ActiveMQ Artemis?

ActiveMQ Artemis is an open-source project for an asynchronous messaging system. It is high-performance, embeddable, clustered, and supports multiple protocols.

Q19. What is JMS?

JMS is an application programming interface(API) that provides Java language functions for handling messages. It was developed by IBM in partnership with Sun Microsystems. It is used for sending messages between two or more clients.

Q20. Explain the architecture of Activemq?

The architecture of apache ActiveMQ contains three main parts. They are brokers, destinations, and client applications.

The client applications in the ActiveMQ uses the org.apache.ActiveMQ package to define the core JMS client. Non-JMS clients can also connect to the ActiveMQ broker using the AMQP, MQTT, and STOMP protocols.

ActiveMQ uses a broker as an intermediatory between the clients and the destinations. The APIs for the message broker is defined in the package org.apache.activemq.broker.

The client and the message broker use the Transport abstraction to send and receive the objects.

Q21. What protocols are supported by ActiveMQ?

MQP, MQTT, OpenWire, and STOMP are few protocols that are supported by ActiveMQ

Q22. What is default port of ActiveMQ?

8161 is the default port of ActiveMQ.

About Author :

  • Author of ActiveMQ Interview Questions

    Subrata Dutta

    Subrata Dutta is IT Project Manager from Noida, Uttar Pradesh, India. He is an exceptional team player who is proactive, efficient, methodical and has strong interpersonal & people management skills.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.