Feeds

Programming message services in Java

Asynchronous interactions seem to be the way of the future

The essential guide to IT transformation

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.

Secure remote control for conventional and virtual desktops

More from The Register

next story
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Mozilla's 'Tiles' ads debut in new Firefox nightlies
You can try turning them off and on again
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
Scratched PC-dispatch patch patched, hatched in batch rematch
Windows security update fixed after triggering blue screens (and screams) of death
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Advanced data protection for your virtualized environments
Find a natural fit for optimizing protection for the often resource-constrained data protection process found in virtual environments.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.