Apache ActiveMQ Configuration *In Windows

Apache ActiveMQ

This tutorial will show you how you can configure Apache ActiveMQ in Windows platform. Apache ActiveMQ™ is the most popular open source, multi-protocol, Java-based messaging server. It supports industry standard protocols so users get the benefits of client choices across a broad range of languages and platforms. Connectivity from C, C++, Python, . Net, and more is available.

Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server. It is fast and supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4.

Features of Apache Active MQ

  • Supports a variety of Cross Language Clients and Protocols from Java, C, C++, C#, Ruby, Perl, Python, PHP
  • Full support for Enterprise Integration Patterns both in the JMS client and the Message Broker
  • Supports many advanced features such as Message Groups, Virtual Destinations, Wildcards and Composite Destinations
  • Full support for JMS 1.1 and J2EE 1.4 with transient, persistent, transactional and XA messaging
  • ActiveMQ can be easily embedded into Spring applications and configured using Spring’s XML configuration mechanism
  • Tested inside popular JEE servers such as TomEE, Geronimo, JBoss, GlassFish and WebLogic
  • Supports pluggable transport protocols such as in-VM, TCP, SSL, NIO, UDP, multicast, JGroups and JXTA transports
  • Supports very fast persistence using JDBC along with a high performance journal
  • Designed for high performance clustering, client-server, peer based communication
  • REST API to provide technology agnostic and language neutral web based API to messaging
  • Ajax to support web streaming support to web browsers using pure DHTML, allowing web browsers to be part of the messaging fabric
  • CXF and Axis Support so that ActiveMQ can be easily dropped into either of these web service stacks to provide reliable messaging
  • Can be used as an in memory JMS provider, ideal for unit testing JMS

Setup Configuration

Setup configuration for Apache Active MQ is very simple and easy to start the broker.

  • Download Apache ActiveMQ from http://activemq.apache.org/
  • Extract the downloaded file, i.e., apache-activemq-a.bc.d-bin.zip to a drive of your choice, for example, C drive.
  • Navigate to C:\apache-activemq-a.bc.d\bin directory from the command prompt and execute the command activemq start.
  • Once the ActiveMQ gets started you will see the similar output at the end in the command prompt at the end.
 INFO | Connector ws started
 INFO | Apache ActiveMQ 5.xy.z (localhost, ID:DESKTOP-KDLKCQ0-55578-1601551676994-0:1) started
 INFO | For help or more information please see: http://activemq.apache.org
 INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/
 INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/
  • Now open http://localhost:8161/ in the browser and click on link Manage ActiveMQ broker; when prompt for the username and password, put admin/admin.
  • Next you will see many links such as Home, Queues, Topics, Subscribers etc.
  • Now click on Queues. Next give a Queue name – TestQueue – in the input box and click on Create.

ActiveMQ create a Queue

  • Click on Send To link to the right side of the TestQueue name row.

ActiveMQ click on link Send To

  • Now create a message and send it to TestQueue

ActiveMQ create a message and send it to TestQueue

  • Once you click on Send button you will see one message is enqueued in the TestQueue. As no consumer is defined for this TestQueue, so message will not be dequeued from TestQueue.

ActiveMQ message pending in TestQueue

  • Now click on TestQueue, then click on Message ID (ID:…). You will see the message details.

Note: You must have JDK installed

For maven based application add the following dependency to your pom.xml file:

<dependencies>
	<dependency>
		<groupId>org.apache.activemq</groupId>
		<artifactId>activemq-all</artifactId>
		<version>5.18.3</version>
	</dependency>
</dependencies>

For gradle based application, use the following dependency in your build.gradle script.

dependencies {
    implementation 'org.apache.activemq:activemq-all:5.18.3'
}

For Spring Boot application you need the following dependency in pom.xml file:

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-activemq</artifactId>
	<version>3.1.5</version>
</dependency>

That’s all about configuring Apache Active MQ in Windows environment.

Leave a Reply

Your email address will not be published. Required fields are marked *