This blog post will cover the HTTP Retry process using a Groovy script and Looping process call combination. Sometimes, we get a temporary time out error on the HTTP endpoint. To tackle this, we can use this mechanism to do a http retry for a specific interval / specific number of times. Overall iFlow Design: Set Properties in Content modifier: For the Groovy script to work, we need to declare the below properties. Looping Process Call: HTTP Retry Groovy Script: If the HTTP Response code is greater than or equal to 400, the script will retry depending on the retry_interval and retry_limit properties. ------------------------------------------------------------------------------------------------------------- import com.sap.gateway.ip.core.customdev.util.Message; import java.util.HashMap; def Message processData(Message message) { def map = message.getHeaders(); def httpStatusCode = map.get("CamelHttpResponseCode") as In...
Requirement is to extract the repeated XML node with Static parent node. Step 1 - Here, I am passing input in the Content modifier itself. Sample Input: <Root> <Employee> <Name>Akshay</Name> <ID>1</ID> </Employee> <Employee> <Name>Sudeep</Name> <ID>2</ID> </Employee> <Employee> <Name>Advik</Name> <ID>3</ID> </Employee> <Employee> <Name>Hirva</Name> <ID>4</ID> </Employee> </Root> ----------------------------------------------------------------------------------------------------------------------------- Step 2 : Declare Property variables to hold the output. Name_Concat string-join(/Root/Employee/Name, ",") ID_Concat string-join(/Root/Employee/ID, ",") Below is the config. of the message body tab of the content modifier: -------------------------------------------------- ...
Comments
Post a Comment