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.