Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to access request.content within Fault Rule?

From the documentation and in the forum I understood that request.content should be available even if Apigee enters an error state (i.e. it should be accessible from within a Fault Rule), but when I try to access it, I get nothing back. I am able however to access request.path and request.verb.

Here's the scenario I have in my application, which is an interaction between two systems (and consequently two proxies). Let's call them A and B:

  1. The Proxy A will receive a request and try to allocate a resource in System A.
  2. If successful, in the response part of Proxy A it will do a service callout (SC) to the Proxy B.
  3. Proxy B will send the request to System B to then operate on the resource.
  4. If Proxy B fails for any reason, I have a Fault Rule that sends the request back to System A (with a different path suffix) to deallocate the resource

There is a single message that contains the details required for allocation & deallocation of the resource in System A, and operation on the resource by System B. So I want to just send request.content in my SC payload, but when in the debug interface I see the request.content as empty.

I asked Gemini about this, and it told me the request.content would not be available if it's been altered by another flow/step before the error takes place, but I don't think that is the case in my proxy.

So my questions are:

  • Should the request.content indeed be available in the error state?
  • If yes, what could be happening in my proxy that prevent this from being the case?
1 2 238
2 REPLIES 2