ActiveMQ Interview Questions

ActiveMQ Interview Questions | Freshers & Experienced

  • Subrata Dutta
  • 23rd Nov, 2019
  • 1089 Followers

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?

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.

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.