How to rollback first service callout if the second service callout fails?

My proxy is using two service callout policies and I am looking for the best approach to implement rollback for the first service callout incase the second one fails. How can I achieve it?

0 2 129
2 REPLIES 2

sidd-harth
Participant V

All calls in Apigee are synchronous. AFAIK there is no rollback option for Service Callout policy.

Note - Service Callout can be asynchronous if you remove Response tag, but this doesnt solve your requirement.

@Harpreet Chawla

There is no transaction management in Apigee. You will need to write your own logic in the fault handling to do this. If your first service has some kind of compensation logic exposed, you can try handling the fault/error for the second service callout by making a call to the first service rollback endpoint to undo the changes previously done.