Skip to main content
Please wait...
Java Message Service (JMS) as Part of a MOM
07 Jun, 2025

Java Message Service (JMS) as Part of a MOM

Overview 

Java Message Service (JMS) is a Java API for asynchronous, reliable messaging between applications, commonly used in enterprise systems. It integrates with Message-Oriented Middleware (MOM), where producers send messages to destinations (queues or topics), and consumers receive them. MOM supports two models: Point-to-Point (one sender, one receiver) and Publish/Subscribe (one sender, multiple subscribers). JMS uses Connection Factories to establish connections and Destinations to define message targets. IBM CICS Transaction Server supports JMS via Liberty (managed) and OSGi (unmanaged) JVM servers. Apache ActiveMQ, a JMS-compliant broker, supports queues, topics, persistence, and integration with Java frameworks like Spring. 

 

What is Java Message Service (JMS)? 

Java Message Service (JMS) is a Java API that enables applications to communicate through asynchronous, loosely coupled, and reliable messaging. It is part of the Java EE (Jakarta EE) platform and is widely used in enterprise applications. 

 

JMS in Message-Oriented Middleware (MOM) 

Message-Oriented Middleware (MOM) is software that facilitates communication between distributed systems using messages. JMS acts as a standard API for Java applications to interact with MOM systems. 

How JMS fits into MOM: 

  • Producers send messages to a destination (queue or topic). 

  • Consumers receive messages from the destination. 

  • The MOM provider (like ActiveMQ or IBM MQ) handles message routing, persistence, and delivery. 

 

Messaging Models in MOM 

MOM systems, including JMS-based ones, support two primary messaging models:

  • Point-to-Point Messaging Model (Queue-based)

    • One sender, one receiver. 

    • Messages are stored in a queue until consumed. 

    • Example: Order processing systems. 

  • Publish/Subscribe Messaging Model (Topic-based)

    • One sender, multiple subscribers. 

    • Messages are broadcast to all active subscribers. 

    • Example: Stock price updates or news feeds. 

 

JMS Connection Factory vs. JMS Connection Factory Destination 

 

Feature 

JMS Connection Factory 

JMS Destination (Queue/Topic) 

Purpose 

Creates connections to the messaging provider 

Represents the target for messages (queue or topic) 

Type 

Administered object 

Administered object 

Used For 

Establishing a connection/session 

Sending to or receiving from a specific destination 

Configuration 

Includes provider URL, credentials, etc. 

Includes destination name/type 

They work together: the Connection Factory establishes the link to the broker, and the Destination specifies where the message goes. 

 

How IBM CICS Transaction Server Uses JMS

IBM CICS Transaction Server (CICS TS) supports JMS to enable Java applications running in CICS to interact with messaging systems like IBM MQ. 

Two Integration Models: 

  • Liberty JVM Server (Managed JMS) [1]

    • Supports JMS 2.0. 

    • Uses managed JMS resources configured via server.xml. 

    • Supports Message-Driven Beans (MDBs) and servlets. 

    • Can connect to IBM MQ or embedded JMS providers. 

    • Integrates with CICS transactions and security. 

  • OSGi JVM Server (Unmanaged JMS)[2]

    • Uses IBM MQ classes for JMS. 

    • Only supports bindings mode (local queue manager). 

    • Uses non-managed JMS resources. 

    • Integrates with CICS transactions and security. 

 

How ActiveMQ Uses the JMS API 

Apache ActiveMQ is an open-source message broker that implements the JMS API, allowing Java applications to send and receive messages using standard JMS interfaces. 

Key Features: 

  • Full JMS 1.1 and 2.0 support. 

  • Supports both queue and topic messaging models. 

  • Offers persistent and non-persistent delivery. 

  • Provides failover, clustering, and load balancing. 

  • Can be embedded in Java applications or run as a standalone broker. 

  • Integrates with Spring, Camel, and other Java frameworks. 

Example: 

A Java application can use javax.jms.ConnectionFactory to connect to ActiveMQ, send a TextMessage to a queue, and another app can consume it asynchronously. 

 

References 

[3] Mythily, M., A. Samson Arun Raj, and Iwin Thanakumar Joseph. "An analysis of the significance of spring boot in the market." 2022 international conference on inventive computation technologies (ICICT). IEEE, 2022. 

[4] Dalkıran, Emre, et al. "Automated integration of real-time and non-real-time defense systems." Defence Technology 17.2 (2021): 657-670.