JMS Quick-Start on Mac OS X
The JMS Tutorial Show Step-by-Step How-to Getting-Started with ActiveMQ for Java Message Service Development on Mac OS X.
As Pre-Requisite for Apache ActiveMQ is the Oracle Java SE JDK 6+ Installation on Mac OS X.
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 Mac OS X:
-
Open Terminal Window
- Starting ActiveMQ Console:
sudo su
/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 is 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.
| Getting-Started with ActiveMQ for JMS on Mac OS X Easy Guide