877-277-2477
info@capstonecourseware.com
120. The Java Message Service
Version 1.1

Book cover

This course teaches everything that most Java developers will need to know about asynchronous messaging using the Java Message Service, or JMS. Both the point-to-point and publish-and-subscribe messaging styles are covered, but there is an emphasis on the more popular point-to-point approach using message queues. The course moves quickly from JMS fundamentals -- connections, sessions, queues, topics, etc. -- to intermediate techniques such as message properties and selectors. By the end of the day, students will understand JMS reliability and be able to make intelligent architectural choices between delivery modes, acknowledgement modes, and transacted sessions.

Prerequisites

  • Solid Java programming experience is required -- consider Course 103 or its equivalent a firm prerequisite.
  • An understanding of Java web applications will be helpful, but is not required.

Learning Objectives

  • Use JMS queues to manage message transmission between a single producer and a single consumer.
  • Use JMS topics to allow for broadcasting of messages in real time.
  • Use various JMS message types, including text, object, and map-based messages.
  • Set message headers and use properties to define additional information about messages.
  • Use message selectors to filter messages in consumption.
  • Trigger redelivery of messages using various acknowledgement modes and techniques.
  • Use JMS transactions to assure that message receipts and sends are grouped into atomic units of execution.

Timeline: 1 day.

IDE Support: Eclipse 3.2

  • In addition to the primary lab files, an optional overlay is available that adds support for Eclipse 3.2. Students can code and build all exercises from within the IDE. Final build and deploy, and testing using application clients, are done from the command line using Ant. See also our orientation to Using Capstone's Eclipse Overlays, and please be advised that this is an optional feature; it is not a separate version of the course, and the course itself does not contain explicit Eclipse-specific lab instructions.

Chapter 1. Fundamentals

  • Asynchronous Messaging
  • The Java Message Service
  • Point-to-Point Messaging
  • Publish-and-Subscribe Messaging
  • JNDI
  • Connections and Sessions
  • Working with Queues
  • Working with Topics
  • Expiration

Chapter 2. Message Content

  • Message Types
  • Header Fields
  • Properties
  • Message Selectors

Chapter 3. Reliability

  • Message Persistence
  • JMS from Web Applications
  • The Component Environment
  • Acknowledgement and Redelivery
  • Acknowledgement Modes
  • Session Recovery
  • Transactions
  • What JMS Transactions Are and Aren't
  • Transaction Pitfalls
  • Batch Processing
  • Priority
  • JMS and EJB: Message-Driven Beans
  • JMS and Web Services: SOAP Messaging

Appendix A. Learning Resources

System Requirements

Hardware Requirements (Minimum) 500 MHz, 256 meg RAM, 500 meg disk space.
Hardware Requirements (Recommended) 1.5 GHz, 512 meg RAM, 1 gig disk space.
Operating System Tested on Windows XP Professional. Course software should be viable on all systems which support the J2EE 1.4 reference implementation.
Network and Security Limited privileges required -- please see our standard security requirements.
Software Requirements All free downloadable tools.