Skip to content

Files

Latest commit

 

History

History

samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sample Programs

This directory contains programs demonstrating some features of Spring Boot JMS programs.

The programs all have a RUNME.shscript that uses gradle to compile and run the programs. They also have a resource file with externally-configured properties that control how the connection is made to a queue manager. You may need to modify those properties to match your environment. The README in the root of this repository lists the available properties.

All samples are now using JMS3/Jakarta forms of the Java classes and have been renamed to remove any "jms3" suffix. Older versions of the samples have been removed.

The Atomikos samples have not been updated to use the latest Spring Boot, as the package currently fails to build against it. See this issue in the Atomikos repository.

Contents

  • s1 - The simplest example that creates two connections to MQ: one to put a message, and the other to act as a JMSListener that retrieves the message.
  • s2 - Demonstrates use of local transactional control to commit and rollback changes
  • s2.tls - Identical to s2 but with information about using a TLS-enabled connection in a Spring Boot 3.1 environment, using SSLBundles to setup the secure connection. Configuration uses a yaml file instead of a properties file.
  • s3 - A request/reply program, with both the requester and responder in the same application. The responder side shows how transactions can be controlled within a JMSListener.
  • s4 - Shows how to connect to multiple queue managers in the same application and using an XA transaction coordinator to reliably transfer messages between them
  • s4n - Functionally identical to s4, but using Narayana as an alternative transaction manager
  • s4a - A modified version of s4 using a JmsListener instead of a polling Receiver

Other resources

Many other sample programs for MQ can be found in this repository. Those examples have demonstrations of additional features and alternative ways to build and run JMS programs. For example, using maven instead of gradle.