About Claus Ibsen

Claus Ibsen is a principal software engineer from Red Hat. Claus is working full time as Apache Camel committer. And is author of the "Camel in Action" book.

Apache ActiveMQ 5.9 released

The Apache ActiveMQ team has just released the new ActiveMQ 5.9 release.

This release is 8 months of hard work since the previous 5.8 release.

In this release we have as usual more hardening of the broker, and the recent new protocols such as AMQP and MQTT. Also very interesting is the hardening of the leveldb persistent store, which now also includes a new replication functionality. Over time level db is planned to be default out of the box persistent store, instead of the current kahadb store. Though we are not there yet, so kahadb is still the default store.

Another great new functionality is the ability to do runtime configuration changes to the broker without having to restart the broker. You cannot change everything yet, but you can for example update network connectors when you have clustered brokers etc. The documentation details which parts can be updated.

For the Camel users then there is a new broker component which allows lighter inter broker routing. Rob Davies have previously blogged about that, and provides an interesting use-case which allows to use Camel routing logic to decide if sending a message to a queue should go into the queue, or to another queue, depending on the current queue depth.

Last but not least Apache ActiveMQ now ships with hawtio as its new web console out of the box. The old web console is still there, but is considered deprecated.

We also cleaned up in the conf directory, moving all the example configurations into examples/conf.

Apache ActiveMQ 5.9 release notes is here.

Starting Apache ActiveMQ

To try out Apache ActiveMQ is easy. You go to the activemq.apache.org web site and click the download link. Then you can download a zip or tgz file of the distribution. Then you unzip/untar the file and then you can start the broker from the command line as shown below:

davsclaus:/opt$ tar xf ~/Downloads/apache-activemq-5.9.0-bin.tar.gz
davsclaus:/opt$ cd apache-activemq-5.9.0/
davsclaus:/opt/apache-activemq-5.9.0$ bin/activemq console

When the broker is staring up it now logs all the transport connectors it provides and their urls.

From the logs below we can see that …

INFO | Listening for connections at: tcp://davsclaus.air:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector openwire started
 INFO | Listening for connections at: amqp://davsclaus.air:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector amqp started
 INFO | Listening for connections at: stomp://davsclaus.air:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector stomp started
 INFO | Listening for connections at: mqtt://davsclaus.air:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector mqtt started
 INFO | Listening for connections at ws://davsclaus.air:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector ws started

we have the following transport connections enabled

  • openwire – is the JMS protocol
  • amqp – AMQP 1.0
  • stomp – is a very simple text based protocol, you can use from telnet
  • mqtt – for machine to machine communication
  • ws – websocket (stomp or mqtt)

Telnet to the broker

For example with stomp we can connect to the broker using telnet, and type in the telnet shell stomp commands to connect, send and receive messages. For example to connect i can type:

telnet localhost 61613
CONNECT
login:foo
passcode:bar

^@

And the broker will response with:

CONNECTED
heart-beat:0,0
session:ID:davsclaus.air-61798-1382433481104-2:1
server:ActiveMQ/5.9.0
version:1.0

And I can then disconnect with:

DISCONNECT

^@
Connection closed by foreign host.

There is a user guide here how to use telnet with stomp.

Accessing the web console

When ActiveMQ broker starts up it logs the url for the web console(s):

INFO | ActiveMQ WebConsole available at http://localhost:8161/

So just open a broker on that link. When you access the console its secured, so you need to login. The broker comes with a default user and password, which you can see in the conf/users.properties file.

There is also a docs/WebConsole-README.txt file that provides more details about the web-consoles, and how you can turn on|off login etc.

For example with hawtio web console we can create queues, and send messages to the queues. In the screenshot below I have created two queues: beer and wine, and send a message to the beer.


The console has actions to move messages between queues, browse, and delete. And messages in dead letter queues, can be resubmitted to their original queue, which allows to retry processing the message(s).

Trying the ActiveMQ web examples

Apache ActiveMQ comes with a few web examples you can try by starting the broker as follows

bin/activemq console xbean:examples/conf/activemq-demo.xml

To try the examples then open the web browser at http://localhost:8161/ and click on the last link. PS you should also try clicking on the web console link (hawtio) as the web console now also shows the Camel plugin, as one of the examples is using Camel.
 

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


× 4 = sixteen



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close