Feeds

Programming message services in Java

Asynchronous interactions seem to be the way of the future

Combat fraud and increase customer satisfaction

Lately I seem to be involved increasingly in systems relying on asynchronous interactions for efficient and effective integration. In these cases, the asynchronous behaviour has been implemented using JMS (or Java Message Service) queues, with message driven beans, and with the underlying message server provided by application servers such as WebLogic, WebSphere and JBoss.

As a point to note, "asynchronous" here indicates that the initiating process (the client) returns immediately that a message is sent rather than waiting for the invoked process to complete before returning. This is usually desirable if the invoked process is long running or may require human intervention.

Although JMS has been around for some time, I’ve found that knowledge of how JMS works and its use with EJB3 Message Driven Beans is actually quite limited and I realise that I’ve never actually written a column about JMS before. This Java column therefore looks at what JMS is, how it works, and at the use of queues. It also provides an example of implementing a JSM client and an EJB3 based Message Driven Bean (MDB) to act as the consumer of JMS messages.

Java Message Service

The Java Message Service (more commonly referred to as JMS) is a standard Java Standard Edition API that can be used to access a variety of different message servers. Although the name might suggest otherwise, it’s not of itself a message service, but rather a generic interface to a message server.

In this sense, it’s similar to the JDBC and JNDI, in that it is trying to provide a standardised and unified interface to a variety of disparate vendor specific message servers. In the case of JMS, you use JMS to interface to message services such as IBM’s MQ Series message service, the JBoss MQ messaging system, or Oracle AQ queues etc.

The JMS API is defined within the javax.jms package. This package defines numerous interfaces, only two classes, and a number of exceptions. Before going into further detail about JMS we’ll look at the general concepts behind messaging services.

High performance access to file storage

More from The Register

next story
Android engineer: We DIDN'T copy Apple OR follow Samsung's orders
Veep testifies for Samsung during Apple patent trial
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Windows XP still has 27 per cent market share on its deathbed
Windows 7 making some gains on XP Death Day
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
prev story

Whitepapers

Designing a defence for mobile apps
In this whitepaper learn the various considerations for defending mobile applications; from the mobile application architecture itself to the myriad testing technologies needed to properly assess mobile applications risk.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.