Thursday, 16 April 2020

Delay processing of iflow on every message in SAP CPI

Processing delay of 8s for every messages sent to the end system.

1. Replace xml node
2. delay code of 8 secs

Groovy Script

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import java.lang.*

def Message processData(Message message) {

def body = message.getBody(java.lang.String) as String;

body = body.replaceAll("\\<\\?xml(.+?)\\?\\>", "").trim(); //Replace xml node

message.setBody(body);


sleep(8000)    // wait for 8 secs

return message;
}



No comments:

Post a Comment