I am trying to consume 3rd party API response through WSO2 APIM 3.2
I have an outflow custom mediator in place. Which is doing nothing but just an empty class (source is given below)
public class OutFlowMediatorDummy extends AbstractMediator {
private static final Log log = LogFactory.getLog(MarketplaceOutFlowMediatorDummy.class);
@Override
public boolean mediate(MessageContext messageContext) {
log.info("Outflow mediator execution ended");
return true;
}
}
The endpoint which I used as the service backend is Jira issue api.
Problem:
When API is invoked without the outflow mediator in place, I can get the successful response.
When API is invoked with outflow mediator in place, an exception is thrown from Synapse (given below)
TID: [] [] [2022-03-25 08:41:54,866] ERROR {org.apache.synapse.transport.passthru.util.DeferredMessageBuilder} - Error building message org.apache.axis2.AxisFault: #Can not parse stream. MessageID: urn:uuid:0680f270-3d32-42c0-9c61-107ef655be0e. Error>>> #getNewJsonPayload. Could not save JSON payload. Invalid input stream found. Payload is not a JSON string.
I also traced the WIRE logs for this respective API call and it seems to be sending the valid JSON response together with correct content type (see below)
Description:
I am trying to consume 3rd party API response through WSO2 APIM 3.2 I have an outflow custom mediator in place. Which is doing nothing but just an empty class (source is given below)
The endpoint which I used as the service backend is Jira issue api.
Problem: When API is invoked without the outflow mediator in place, I can get the successful response. When API is invoked with outflow mediator in place, an exception is thrown from Synapse (given below)
TID: [] [] [2022-03-25 08:41:54,866] ERROR {org.apache.synapse.transport.passthru.util.DeferredMessageBuilder} - Error building message org.apache.axis2.AxisFault: #Can not parse stream. MessageID: urn:uuid:0680f270-3d32-42c0-9c61-107ef655be0e. Error>>> #getNewJsonPayload. Could not save JSON payload. Invalid input stream found. Payload is not a JSON string.
I also traced the WIRE logs for this respective API call and it seems to be sending the valid JSON response together with correct content type (see below)
Is this a known but? do we have any workaround to resolve this issue ?
Steps to reproduce:
This only happens for some backend APIs. For other this seems to be working fine.
Affected Product Version:
wso2am-3.2.0.140
Environment details (with versions):