Hi,
I get following Error from backend. Looks like backend was designed to return 204 with some content..
Apigee throws following error in Trace, when it encounter such situation
Properties | |
error | Received 204 Response with message body |
type | ErrorPoint |
state | REQ_SENT |
error.class | com.apigee.errors.http.server.BadGateway |
Identifier | Fault |
Is there any ways to format above error to below as success and respond to client (Like a success not error). Finally responded as
Response (no content) (header: Status: 204 No Content)
Above is the way current backend respond but Apigee returns error.
Tried following approach.
Approach 1.Used Assign message to remove the “Accept-Encoding” and put into TargetEndpoint Request “Postflow” but this error still occurs (As below)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
<DisplayName>Assign Message-1</DisplayName>
<Properties/>
<Remove>
<Headers>
<Header name="Accept-Encoding"/>
</Headers>
</Remove>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
Approach 2.Tried the approach of updating the properties to below, but did not work
<HTTPTargetConnection>
<Properties><Property name="success.codes">204</Property></Properties>
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
<URL>https://backendurl.com</URL>
</HTTPTargetConnection>
Or below approach also does not work
<Properties><Property name="success.codes">204 No Content</Property></Properties>
3. Looks like the error object is only accessible when proxy reaches error state, not the response object in error state.. hence approach of accessing response object and customizing to success (per business requirements) in this case would be ? Please comment..
AssignMessage is one approach but if I want to use below information to success how really the Assign Message should handle and what variable need to update or capture what kind of match ? .
To respond to client as below instead of Apigee indicated error
Response (no content) (header: Status: 204 No Content)
Please suggest any other approach which you think would response with such situation