I have a simple proxy which forward the incoming request to a target server and send back the response to the client.
I want to log the response received from the target server and the response sent to the client.
To archieve this, I put :
a response PreFlow in the Target endpoint to log the response received from the target server
a response PostFlow in the Proxy endpoint to log the response sent to the client
Everything is working, except when the proxy received an error from the Target server : the response PostFlow in the Proxy endpoint is not executed even if I put a FaultRule in the Target endpoint.
Hi @vbroucke , thank you for your question and for your patience! We’re closely following this conversation and ensuring you get a response. In the meantime, we’d like to invite other community members to share their insights.
Also, don’t forget to join us at our upcoming virtual event this week on Nov 14, “Spec-Driven Development for Apigee: A Fully Automated CI/CD Approach.” Your participation is always welcome!
The great thing about PostClientFlow is that it always runs after the client gets sent the response, so you have access to all info from the target, errors, responses, etc.. and you can then push them to logging or tracing without impacting the response to the client..
Ok understand, the FaultRule will catch the error, but not help you resume the normal response flow… I would check if you can continue on error by setting the success codes for the target, or just adding your logging policy to the fault handling as well.. either way should work.
Hi @vbroucke , thank you for your question. We appreciate the responses provided @tyayers .
If either of the provided responses addresses your question, please consider marking the response as an accepted solution. This helps other community members who might have similar questions.
Additionally, we encourage you to explore our latest articles and resources in the community.