Tuesday, April 03, 2007

IA: Java Message Service

From my research, it seems like JMS is something like email between applications. It provides a means (that's why it's considered middleware) for applications to send messages to each other. I didn't run into any basic examples, but I'm guessing since we're covering logging and monitoring right now in class that it has something to do with error reporting. Perhaps if an application runs into an error it can communicate that error to another application that alerts someone who can take care of the problem. At any rate, below is a bit of research I did on the basics of JMS. Hopefully class tomorrow will shed some more light on the functionality of this service.

JMS uses formats based on XML and is capable of talking with both local and remote databases and business applications.

The Java Message Service consists of the following elements:

  • JMS provider: an implementation of the JMS interface for a Message Oriented Middleware.

  • JMS client: An application or process that produces and/or consumes messages:
  • JMS producer: A JMS client that creates and sends messages
  • JMS consumer: A JMS client that receives messages
  • JMS message: an object that contains the data being transferred between JMS clients.
  • JMS queue: a staging area that contains messages that have been sent and are waiting to be read.
  • JMS topic: a distribution mechanism for publishing messages that are delivered to multiple subscribers

Point-to-point (Queuing model)

Producer posts message to a particular queue and a consumer reads the messages.

  • Only one consumer will get the message
  • Producer and receiver don't need to be running at the same time
  • All messages successfully processed are acknowledged by receiver

Publish/Subscribe Model

  • Supports publishing messages to a particular message topic. Neither publisher nor subscriber know about each other.
    • Multiple consumers can receive the message
    • Timing dependency between publishers and subscribers. Subscriber has to remain continuously active to receive messages, unless it has established a durable subscription.

Open Source JMS Provider Implementation

  • Apache Active MQ
  • OpenJMS from The OpenJMS Group

Proprietary providers:

  • WebSphere Application Server from IBM
  • WebSphere MQ from IBM
  • SAP NetWeaver WebAS JavaJMS from SAP AG
  • Oracle AQ
  • Sun Java System Message Queue

A comparison matrix of JMS providers can be found at: http://www.theserverside.com/reviews/matrix.tss



Bond, Haywood, et. al., Sams Teach Yourself J2EE™ in 21 Days, Second Edition, 2004

No comments: