Book Image

HornetQ Messaging Developer's Guide

By : Piero Giacomelli
Book Image

HornetQ Messaging Developer's Guide

By: Piero Giacomelli

Overview of this book

<p>Messages and information can be exchanged at exponential speed with JBoss HornetQ asynchronous messaging middleware. Learn how to use the JAVA open source Message Oriented Framework, to build a high-performance, multi-protocol, embeddable, clustered system and manage millions of messages per second.<br /><br />In the HornetQ Messaging Developer’s Guide you will find the most common applications of a message exchanger with example code, as part of real-world scenarios. This practical and applicable guide increases reader knowledge chapter by chapter, covering basics to the most advanced features.<br /><br />You will start from a clean installation of a HornetQ sever and, having progressively become a HornetQ master, will finish by being able to use the framework embedded in your software and sharing information in a cluster environment.<br /><br />Starting from writing and reading a single message, we will discover more advanced features like managing queues, clustering the server, and controlling the undelivered messages. The book deals with a real-world advanced medical scenario as the main example that will lead you from learning the basics to the advanced features of HornetQ.</p>
Table of Contents (18 chapters)
HornetQ Messaging Developer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Coding our example


Without entering in to too many details what we are going to do is basically create a simple Spring Console application that will produce and consume the usual ECG message on the usual ECGQueue queue. To do this we need to follow these steps:

  1. Create a Spring project, which is the easy task.

  2. Create an interface for our Bean, where we will define the only method that will be called.

  3. Create an implementation class for the Bean interface, where we will create and consume the JMS message.

  4. Create a definition file that will map the method on the Bean implementation to an XML definition.

  5. Create a method interceptor to correctly invoke the Bean.

  6. Finally we will create a tester class that will be used to display the results.

So let us start with the project creation.

From the IDE go to File | Menu | Spring Project and name it SpringHornetqExample. You should have the following IDE perspective:

Now we need some Spring JAR files and the usual HornetQ JAR files. The Spring JAR files to be...