A different way to restart SAP CPI content

It is pretty difficult to restart SAP CPI messages from any external applications. There is just two ways that include either the Enterprise Messaging/JMS or the Datastore. Some times this can create some complex scenarios for the user to develop.

We wanted to make some of the development a little easier. It requires just one groovy script and two script steps in your iflow. We will show a different way that allows you to restart messages in an external application and setup rules for how often it can be reprocessed. We leverage that the Figaf IRT application is able to download messages that have a specific filter like Receiver is LOG. Then the message will be downloaded and you can apply some rules to it like it should be reprocessed 3 times. There is also the option to send notifications to emails or systems like Jira.

Check out the video where you can see how simple it is to restart a SAP CPI message.

We currently do not know how this will affect count of connections on your SAP CPI system, so use with caution.

You can try out Figaf IRT on your own system. We have both a cloud and an on-prem version to deploy the application.

You can see the code below, it will be updated so you can find a more uptodate version in the IRT application.

package com.figaf.irt
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def Message initalSave(Message message) {
    try {
        def body = message.getBody(java.lang.String)
        def base64 = body.bytes.encodeBase64().toString()
        Map map = message.getHeaders()
        map.put("body", base64)
        def json = JsonOutput.toJson(map)
        def cache = new InputStreamCache(json.bytes)
        // we save the json as a property, so we can restore it in the pipeline
        message.setProperty("IRTSAVE", cache)
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    return message
 * An error have occurred then save the payload as an attachement
 * @param message
 * @return
def Message savePayload(Message message) {
    try {
        def messageProperties = message.getProperties()
        def ex = messageProperties.get("CamelExceptionCaught")
        if (ex == null) {
            return message
        def irtpayload = message.getProperty("IRTSAVE")
        JsonSlurper jsonSlurper = new JsonSlurper()
        def map = jsonSlurper.parseText(irtpayload.getText())
        map.put("Cause", ex.getClass().getName() + ":" + ex.getMessage())
        irtpayload = new InputStreamCache(JsonOutput.toJson(map).bytes)
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream()
        def messageLog = messageLogFactory.getMessageLog(message)
        messageLog.addAttachmentAsString("IRTSAVE", new String(bytesOut.toByteArray()), "application/json")
        message.setHeader("SAP_Receiver", "LOG")
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    return message

IRT Transporting – Improve your SAP CPI life

In this blog, I will cower how IRT Cloud will improve the way you work with transporting.

Before we get started, we need to find a clear definition of what “DevOps” are. According to wikipedia it goes like this:

DevOps is a set of software development practices that aim to shorten the systems development life cycle while delivering features, fixes and updates frequently in close alignment with business objectives

Understand what is changed

Track what object is being changed
– Is it a part of the BPMN model
– Is it scripts or mappings
– Is it configuration which is changed

Register changes with business reason

Make a service request in the IRT tool, that allow you to link the changes to the reason.

User can assign changes in iFlows to it:

Test the changes

With the build in testing tool you are able to test the modification you make does not not affect anything unexpected.

You can document what test you have run and the result of them.

iFlow configuration in the landscape

Configure an iflow once and then let IRT handle configuration in the landscape once importing the change:

Transport individual

Be able to import changes into target system. Figaf will import the object into the target system. Then configuration will be applied:

Check out the demo

So, I if want to check out how this work, please take a look at the demo video below:

So, I you ready to try Figaf IRT/Cloud to see, what IRT/Cloud can do for you? I offer a 30 days free trial at