JMS Quick Start on Red Hat Linux
The JMS Tutorial Show How to Getting-Started with ActiveMQ for Java Message Service Development on Red Hat Enterprise Linux Desktop.
As Pre-Requisite for Apache ActiveMQ is the Oracle Java SE JDK 8+ Installation on Red Hat Linux.
Some ActiveMQ Framework Features:
- Fully JMS Compliant
- Connectivity (Wide range of Connectivity Options with protocols: Http/s, IP multicast, STOMP, TCP, UDP, XMPP)
- Pluggable persistence and security
- Building messaging applications with Java
- Integration with application servers (Apache Tomcat, Jetty, Apache Geronimo, JBoss)
- Client APIs (C/C++, .NET,Perl,Python,Ruby and more)
- Broker clustering (Many ActiveMQ brokers can work together as a network of brokers for scalability purposes)
- Dramatically simplified administration
Get Installed Apache ActiveMQ on Red Hat Linux
Installing ActiveMQ for RHEL
Open a Shell Terminal Emulator Window
In case first see: Terminal QuickStart Guide.
Starting ActiveMQ Console:
su -c "/opt/apache-activemq*/bin/activemq console"
Then Open another Terminal Tab:
Ctrl+Shift+t
Install Apache Ant:
apt-get install ant
Start First, Example:
cd /opt/apache-activemq*/example
ant consumer
The command compiles the Java examples and starts up a simple JMS consumer. As
you can see from the output, this consumer is:
- Connecting to the broker using the TCP protocol (tcp://localhost:61616)
- Watching a queue named TEST.FOO
- Using nondurable subscription
- Waiting to receive 2000 messages before shutting down
Basically, the JMS consumer is connected to ActiveMQ and waiting for messages. Now
you can send some messages to the TEST.FOO destination.
Open a third Terminal Tab:
Ctrl+Shift+t
Start Second Example:
cd /opt/apache-activemq*/example
ant producer
Although the output has been truncated for readability, the command starts up a simple
JMS producer and you can see from the output that it:
- Connects to the broker using the TCP connector (tcp://localhost:61616)
- Publishes messages to a queue named TEST.FOO
- Uses nonpersistent messages
- Doesn’t sleep between publishing messages
Once the JMS producer is connected, it then sends 2,000 messages and shuts down.