cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Checking Retry Count at Runtime in SAP Cloud Integration

Florian_Kube
Participant
0 Likes
1,397

Hi everyone,

I need some help regarding retries in SAP Cloud Integration. Is it possible to determine the current retry count at runtime? I would like to implement a mechanism that aborts a message after, for example, 10 unsuccessful processing attempts.

For JMS, there's the header field header.SAPJMSRetries, but I'm not aware of an equivalent for Kafka. Is there a way to achieve this in a more generic manner? While I know this can be done via the MPL API, I am interested in knowing if there is a direct method to access the retry count.

Thanks in advance for your assistance!

Regards Florian

Florian_Kube_0-1721830755014.png

 

Accepted Solutions (0)

Answers (1)

Answers (1)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Likes

For the pipeline concept we have implemented a retry handling, you may use this as template, check out in any generic flow at https://hub.sap.com/package/PIPipelineGenericIntegrationFlows/integrationflow, for Kafka not sure which header or property is set, but you may find out if switching on the trace, I noticed from your screenshot that trace is switched on already, weren't you able to find out from the trace?

Florian_Kube
Participant
0 Likes
Thank you for your response. I am aware of the pipeline concept and its retry handling capabilities. However, introducing an additional generic step seems unnecessary in my case since Kafka already manages retries. My goal is to directly access the retry count at runtime without adding extra steps. If there's a way to achieve this with Kafka or any direct method, it would be greatly appreciated. I have enabled trace, as you noticed from my screenshot, but I haven't been able to identify the retry count from it.
alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Likes
I reached out to the author of this very blog post https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-what-you-need-to-know-about-t... and he let me know that there are no plans to implement a counter right now, it's not straightforward and may have performance impact, so he would recommend to model the retry on your own within the integration flow model using an exception process, see comment in his blog post: The option to retry a failed message can potentially lead to infinite retries. Therefore, it is recommended to handle failed messages in an exception subprocess
Florian_Kube
Participant
0 Likes
Is there a way to access the runs? I also searched within the Camel framework but was unable to find a relevant field.