Apache ActiveMQ – Admin Console

Apache ActiveMQ – Admin Console ”; Previous Next Once ActiveMQ server is up and running. You can use the admin console to manage queues, topics, subscribers, connections, network etc. Open http://127.0.0.1:8161/admin/ in your browser. It will ask for credentials. Use admin/admin as username/password and it will load the ActiveMQ admin console where you can check Queues, Topics, Connections etc. Queue Click on Queue tab, enter a queue name as testQueue and click on create button. Now you can see the queue in the list. Topic Similarly, you can create Topic and check topics in Topics tab. Others In the same way, you can explore subscribers, connections, network bridges, schedulers details. Send Send tab allows to send a JMS Message to a particular queue or topic by specifying the destination and other details. Print Page Previous Next Advertisements ”;

Apache ActiveMQ – Home

Apache ActiveMQ Tutorial PDF Version Quick Guide Resources Job Search Discussion ActiveMQ is an open source message broker written in Java. It”s fully compliant with JMS 1.1 standards. JMS is a specification that allows development of message based system. ActiveMQ acts as a broker of messages which sits in between applications and allows them to communicate in asynchronous and reliable way. In this tutorial, we”ll cover all the ways of using ActiveMQ which helps in solving the common problems developers/users face in activeMQ based applications. Audience This tutorial is designed for Java programmers with a need to understand the ActiveMQ in detail along with its architecture and actual usage. This tutorial will bring you at an intermediate level of expertise, from where you can take yourself to higher levels of expertise. Prerequisites Before proceeding with this tutorial, you should have a good understanding of Java programming language. Print Page Previous Next Advertisements ”;

Apache ActiveMQ – Features

Apache ActiveMQ – Features ”; Previous Next ActiveMQ is designed to provide high availability, scalability, reliability, performance and security for enterprise level messaging applications. Following are some of the salient features of ActiveMQ. JMS Compliant − ActiveMQ is fully compliant with JMS 1.1 standards. JMS spec provides a standard mechanism for synchronous or asynchronous message delivery, once-and-only-once message delivery, message durability for subscribers, etc. Connectivity Options − ActiveMQ supports HTTP/S, multicast, SSL, Stomp, TCP, UDP, XMPP, thus providing a wide range of options for connectivity and allows various systems to communicate using their choice of protocols. Pluggable Architecture − ActiveMQ allows to choose a persistence mechanism and also provides options to customize security for authentication and authorization as per the application needs. Multi-Platform − ActiveMQ provides client APIs for many popular languages like Java, C, C++, .NET, Perl, PHP, Python, Ruby etc. ActiveMQ Broker will run in JVM but clients can be written using any of the supported languages. Broker Cluster − ActiveMQ allows to prepare a network of brokers for scalability and can support different types of topologies. Features Rich − ActiveMQ provides many advanced features for both broker and clients and support Apache Camel. Simple Administration Interface − ActiveMQ administration console is easy to use but still provides many powerful administration features. Print Page Previous Next Advertisements ”;

Apache ActiveMQ – Running Broker Server

Apache ActiveMQ – Running Broker Server ”; Previous Next We”ve downloaded the latest version of ActiveMQ as mentioned in ActiveMQ – Environment Setup. Now go to the folder F:/ → Apache → apache-activemq-5.16.4/bin and type the following command. Example F:Apacheapache-activemq-5.16.4bin>activemq start Output You”ll see the similar output and ActiveMQ will start running. Java Runtime: Oracle Corporation 11.0.11 C:Program FilesJavajdk-11.0.11 Heap sizes: current=1048576k free=1041918k max=1048576k JVM args: -Dcom.sun.management.jmxremote -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=F:Apacheapache-activemq-5.16.4bin..conflogin.config -Dactivemq.classpath=F:Apacheapache-activemq-5.16.4bin..conf;F:Apacheapache-activemq-5.16.4bin../conf;F:Apacheapache-activemq-5.16.4bin../conf; -Dactivemq.home=F:Apacheapache-activemq-5.16.4bin.. -Dactivemq.base=F:Apacheapache-activemq-5.16.4bin.. -Dactivemq.conf=F:Apacheapache-activemq-5.16.4bin..conf -Dactivemq.data=F:Apacheapache-activemq-5.16.4bin..data -Djava.io.tmpdir=F:Apacheapache-activemq-5.16.4bin..datatmp Extensions classpath: [F:Apacheapache-activemq-5.16.4bin..lib,F:Apacheapache-activemq-5.16.4bin..libcamel,F:Apacheapache-activemq-5.16.4bin..liboptional,F:Apacheapache-activemq-5.16.4bin..libweb,F:Apacheapache-activemq-5.16.4bin..libextra] ACTIVEMQ_HOME: F:Apacheapache-activemq-5.16.4bin.. ACTIVEMQ_BASE: F:Apacheapache-activemq-5.16.4bin.. ACTIVEMQ_CONF: F:Apacheapache-activemq-5.16.4bin..conf ACTIVEMQ_DATA: F:Apacheapache-activemq-5.16.4bin..data Loading message broker from: xbean:activemq.xml INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@53fe15ff: startup date [Sat Feb 26 12:50:18 IST 2022]; root of context hierarchy INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[F:Apacheapache-activemq-5.16.4bin..datakahadb] INFO | PListStore:[F:Apacheapache-activemq-5.16.4bin..datalocalhosttmp_storage] started INFO | Apache ActiveMQ 5.16.4 (localhost, ID:DESKTOP-86KD9FC-52669-1645860020983-0:1) is starting INFO | Listening for connections at: tcp://DESKTOP-86KD9FC:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector openwire started INFO | Listening for connections at: amqp://DESKTOP-86KD9FC:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector amqp started INFO | Listening for connections at: stomp://DESKTOP-86KD9FC:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector stomp started INFO | Listening for connections at: mqtt://DESKTOP-86KD9FC:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector mqtt started INFO | Starting Jetty server INFO | Creating Jetty connector WARN | [email protected]@4f966719{/,null,STARTING} has uncovered http methods for path: / INFO | Listening for connections at ws://DESKTOP-86KD9FC:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector ws started INFO | Apache ActiveMQ 5.16.4 (localhost, ID:DESKTOP-86KD9FC-52669-1645860020983-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/ Verification Now open http://127.0.0.1:8161/admin/ in your browser. It will ask for credentials. Use admin/admin as username/password and it will load the ActiveMQ admin console where you can check Queues, Topics, Connections etc. Print Page Previous Next Advertisements ”;

Apache ActiveMQ – Consumer Application

Apache ActiveMQ – Consumer Application ”; Previous Next Now let”s create a consumer application which will receive message from the ActiveMQ Queue. Create Project Using eclipse, select File → New → Maven Project. Tick the Create a simple project(skip archetype selection) and click Next. Enter the details, as shown below − groupId − com.tutorialspoint artifactId − consumer version − 0.0.1-SNAPSHOT name − ActiveMQ Consumer Click on Finish button and a new project will be created. pom.xml Now update the content of pom.xml to include dependencies for ActiveMQ. <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.tutorialspoint.activemq</groupId> <artifactId>consumer</artifactId> <version>0.0.1-SNAPSHOT</version> <name>ActiveMQ Consumer</name> <dependencies> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jms_1.1_spec</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-jms-client</artifactId> <version>0.40.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.fusesource.mvnplugins</groupId> <artifactId>maven-uberize-plugin</artifactId> <version>1.14</version> <executions> <execution> <phase>package</phase> <goals><goal>uberize</goal></goals> </execution> </executions> </plugin> </plugins> </build> </project> Now create a Consumer class which will receive message from the ActiveMQ Queue. package com.tutorialspoint.activemq; import java.io.Console; import javax.jms.Connection; import javax.jms.Destination; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import org.apache.qpid.jms.JmsConnectionFactory; public class Consumer { public static void main(String[] args) throws Exception { // Create a connection to ActiveMQ JMS broker using AMQP protocol JmsConnectionFactory factory = new JmsConnectionFactory(“amqp://localhost:5672”); Connection connection = factory.createConnection(“admin”, “password”); connection.start(); // Create a session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create a queue Destination destination = session.createQueue(“MyFirstQueue”); // Create a consumer specific to queue MessageConsumer consumer = session.createConsumer(destination); Console c = System.console(); String response; do { // Receive the message Message msg = consumer.receive(); response = ((TextMessage) msg).getText(); System.out.println(“Received = “+response); } while (!response.equalsIgnoreCase(“Quit”)); // Close the connection connection.close(); } } Consumer class creates a connection, starts the session, creates a consumer and then receives message from queue if there is any. If queue contains quit as message then application terminates else it will keep polling queue for messages. We”ll run this application in ActiveMQ – Test Application chapter. Print Page Previous Next Advertisements ”;