Blog Post

JMS Adapter in SAP Cloud Integration

September 27, 2023

Understanding JMS Adapter

Asynchronous messaging is made possible by the JMS (Java Message Service) adapter in SAP CPI (Cloud Platform Integration). Message queues are used by the JMS adapter to schedule and temporarily store incoming messages for processing.

If a message fails, the JMS adapter can be used as a retry mechanism or to resend it.

The way the retry is handled can be configured. The retry interval is set to one minute by default. Another option is exponential back-off, which doubles the time between retries after each one that fails. When you send data using a JMS adapter, if the recipient is unavailable or unreachable, the JMS adapter stores the message in its queue and tries to deliver it again and again until the recipient is reachable or the delivery attempt times out.

JMS Adapter in SAP Cloud Integration

Let us now see the use of JMS Adapter in SAP Cloud Integration,

Create the Sender Flow.

  1. Connect the Sender with the Start using HTTPS Adapter, Make sure to add the address in the connection tab.
  2. Connect the End to the Receiver using the JMS Adapter.
  3. In the Processing tab of the JMS adapter, Add the Queue Name.
  1. Save and Deploy the integration flow.
  2. Open the Postman and try to Post any data.

Create the Receiver Flow

  1. Create a new integration flow as shown in the image below.
  1. Connect the Sender with the Start using JMS Adapter, Make sure to write the same name of the JMS Queue which you have given in the Sender Flow, i.e. is "JMS_Queue".
  2. Add the Groovy Script to print the payload as attachment. Checkout the third script from the Groovy Script blog.
  3. Save and Deploy the iflow.

Please take note that after deploying the second artefact, you have not triggered any messages. A message was already sent to the first flow, therefore it was automatically placed in the JMS queue and made available for consumption by any additional flows. Since the Second artefact is set up to utilise the same JMS queue address, data is directly retrieved from that queue in this instance.

Result

  1. Open the Monitor tab and in the second iflow of the receiver you can see the payload as the attachment, open the attachment and you will see the same message which we have send using postman.
  2. This scenario illustrates that when you transmit data through the JMS adapter, if the recipient is unavailable or unreachable, JMS will save the message in its queue and make repeated delivery attempts until either the recipient becomes accessible or a timeout occurs.

Benefits of JMS Adapter

The Java Message Service (JMS) Adapter is a crucial component in enterprise application integration and messaging systems. It provides several benefits in facilitating communication between different software components and systems. Here are some of the key benefits of using a JMS Adapter:

  1. Standardised Messaging: The Java Messaging Service API, which is a widely used standard for messaging in Java-based applications, is adhered to by JMS Adapter. As a result, it is simpler to integrate multiple technologies because interoperability between various messaging systems and components is ensured.
  2. Asynchronous Communication: Asynchronous communication is made possible via JMS, allowing systems to send and receive messages without holding up for a prompt reply. This asynchronous paradigm improves the responsiveness, scalability, and performance of the system.
  3. Reliability: Messages are securely delivered even in the face of system failures because to JMS capabilities like message durability and acknowledgments. In applications that are mission-critical, this reliability is essential.
  4. Guaranteed Delivery: JMS ensures that messages reach their intended receivers, lowering the possibility of message loss or inconsistent data.
  5. Message Filtering: JMS includes message filtering methods that let users subscribe only to messages that meet particular requirements. This feature speeds up content-based routing and cuts down on pointless message processing.

Conclusion

The JMS Adapter in SAP Cloud Integration is a game-changer for businesses seeking to optimize their integration processes. It ensures reliable communication, robust error handling, and enhanced security, all while simplifying the complexities of data integration. As you consider the future of your business, embrace the power of the JMS Adapter to stay ahead of the competition and drive growth.

LinkedIn 
Forbes Technology Council, Official Member (2022)
LinkedIn
Forbes Technology Council, Official Member (2022)

About the Author

Jaspreet is an Executive Consultant with expertise in SAP, SaaS/Cloud Integrations, Cyber Security and Data Science. Jaspreet is hands-On Architect who does Pre-Sales, Solution Architecture, Development, Lead Delivery of Complex Integration programs, Manage disperse teams and Ensure successful Project Go-Live/Goals. He has made a lasting impact on global businesses IT projects including Aflac, Advanced Energy, Donnelley Financial Solutions(DFIN), Dell EMC and many more.

Do you want to
learn more about integration?

We are dedicated to make our knowledge accessible. You can either figure it out by yourself or you can let us give you a hand.

Let us take care of your integration.

We are SAP Certified and we can make your project happen. Explore our services and contact us. We will be happy to take on your project.

View Our Services