Warning
This page is located in archive.

JMS

MOM = Message Oriented Middleware

Two models:

  • Point-to-Point (JMS Queue)
  • Publish / Subscribe (JMS Topic)

Visualization of model architecture in the end of the Tomas Vitvar lecture: lecture10.pdf

JMS Elements:

  • JMS Provider - JMS API Implementation
  • JMS Producer - Produces messages
  • JMS Consumer - Consumes messages (MessageDrivenBean - MDB)
  • JMS Client - Producer / Consumer
  • JMS Message - The information passed among the JMS clients
  • JMS Queue - Queue to which the message is sent and later is consumed by the consumers
  • JMS Topic - Delivering the message to all registered subscribers

JMS Queue, Point-to-point model

  • 1:1 dependency between the producer and the consumer of the message.
  • There can be more than one consumer, however, the message is always delivered to one of them.
  • The messages exists in the queue until it is consumed by a consumer.
  • The order of the messages is not guaranteed.
  • If one consumer is not able to process the message it is passed to another one.
  • More consumers = horizontal scaling
  • There may be more types of consumers

JMS Topic, Publish / Subscribe model

  • 1:N dependency between the message producer and message consumer
  • The message is processed if all consumers have consumed the message

Experiments

Go through the JMS 2.0 API programming model: JMS 2.0 API programming model

Download the JMS2 exercise by Reza Rehman at JMS 2

CAUTION: The sample is designed for Glassfish/Payara. For Payara on Windows see the following issue and add the system property as described: Payara Issue Should you want to use different application server you need to use the proper Arquillian container module.

In the project there are two folders - problem and solution. Start with the problem folder - it is a standard Maven project. See the java main packages first and understand the functionality. Your task is to implement the tests in the predefined test class.

When ready, or when in doubts, check the solution folder with the sample solution.

JMS 1.1

Should you want to use JMS 1.1, check the experiments from the last year class run (on WildFly / JBOSS app server): JMS 1.1

courses/a4m36aos/cviceni/class_10_12_2015.txt · Last modified: 2015/12/10 08:52 by kopriste