HornetQ Message Broker and Delphi: first steps

HornetQ, the new messaging system from JBoss, now includes support for the Stomp protocol in the development version. Yesterday I run my new Habari client test suite for HornetQ and did some performance tests.

The first thing I noticed was that the development version is very easy to build and set up.

Check out and build

svn co http://anonsvn.jboss.org/repos/hornetq/trunk

After checking out the development trunk with Subversion, I only had to run ‘build distro’ in the root folder.

The build tools Apache Ant and Apache Maven are already included in the checked out version – a very comfortable detail.

Building the binary distribution from trunk generated all binaries in the build output folder, ready to run for usage with Java JMS clients. For the Delphi client library which uses the Stomp protocol, only a small configuration entry is required.

Configure

Adding the Stomp acceptor to the configuration file is the only required configuration step for the test:

build\hornetq-2.1.0.GA\config\stand-alone\non-clustered\hornetq-configuration.xml:

<acceptors>
  ...
  <acceptor name="stomp">
    <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
    <param key="protocol"  value="stomp"/>
    <param key="port"  value="61613"/>
  </acceptor>
  ...
</acceptors>

If the server is running on a different system (such as a Linux virtual machine):

<acceptors>
  ...
  <acceptor name="stomp">
    <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
    <param key="protocol"  value="stomp"/>
    <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>
    <param key="port"  value="61613"/>
  </acceptor>
  ...
</acceptors>

Run the broker

To run the broker, the generated version already provides a script file:

build\hornetq-2.0.0.GA\config\bin\run.bat

A quick check with netstat /a shows that the port 61613 is open, so Stomp is ready to receive messages from Habari HornetQ Client. The Habari HornetQ Client library for Delphi (6 – 2010) and Free Pascal is now in development at habarisoft.com.

Test

I ran the ProducerTool / ConsumerTool test with one million messages on an entry-level laptop (2.1 GHz). Message throughput was high at 2,400 messages per second, including log message output for all messages – sent and received – on the console window. But wait – this is only the result for a HornetQ broker running on Windows. HornetQ introduces a new native disk I/O feature for Linux, so I will have to test this too.

SPECjms2007 benchmark results

With this improved I/O library, HornetQ has performed very well in the SPECjms2007 benchmark obtained by Kai Sachs and Stefan Appel from an independent research group at the TU Darmstadt, Germany. Their release announcement can be found here: www.dvs.tu-darmstadt.de/news/specjms2007Results_HornetQ.html

SPEC® and the benchmark name SPECjms2007® are registered trademarks of the Standard Performance Evaluation Corporation. The results used in the above comparison refer to submissions made on the 17 Sep 2009 and 20 Jan 2010 by TU University Darmstadt

More speed

By default messages are persisted to disk. For higher performance, set the durable flag of the destination to false in the hornetq-jms.xml configuration file.

About JBoss HornetQ

From the General FAQ:

HornetQ is an open source project to build a multi-protocol, embeddable, very high performance, clustered, asynchronous messaging system.  HornetQ is an example of Message Oriented Middleware (MoM)  For a description of MoMs and other messaging concepts please see the chapter 2 of the user manual “Messaging Concepts”.

HornetQ takes over from JBoss Messaging as our premier JMS implementation.

HornetQ can be easily integrated in JBoss Application Server as the JMS provider, it can also be run as a fully functional completely independent standalone messaging server outside of JBoss Application Server, or it can be instantiated in your dependency injection framework of choice, e.g. Spring or Google Guice.  You can even embed HornetQ directly in your own applications.

Habari HornetQ Client announcement

The announcement of Habari HornetQ Client can be found in the Free Pascal Third Party news forum.

Related articles

Getting Started with the HornetQ Messaging System (Javalobby)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s