wso2wso2-esbwso2-enterprise-integrator

WSO2 Micro Integrator: How to handle "application/json; odata.metadata=minimal" content-type from backend?


I'm trying to handle responses with content-type "application/json; odata.metadata=minimal" from a backend service in WSO2 Micro Integrator but facing issues.

[2024-10-29 11:05:53,099] ERROR {JsonStreamBuilder} - Error occurred while processing document for application/json java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566)

What I've already tried:

I've added the following configurations to deployment.toml:

[[custom_message_builders]]
content_type = "application/json; odata.metadata=minimal"
class = "org.wso2.micro.integrator.core.json.JsonStreamBuilder"

[[custom_message_formatters]]
content_type = "application/json; odata.metadata=minimal"
class = "org.wso2.micro.integrator.core.json.JsonStreamBuilder"

but still the same issue.

Full Wirelog

[2024-10-30 09:27:58,660] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "POST /api/data/v9.2/ext_ext_CreatePhoneCall HTTP/1.1[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL3RvcG5ldC1yZWNldHRlLmNybTQuZHluYW1pY3MuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvMzA0ZDg2OGMtZTI3MS00YTkxLTg5NjUtZjI0ZGVkZDc5Y2NmLyIsImlhdCI6MTczMDI3NjU4MiwibmJmIjoxNzMwMjc2NTgyLCJleHAiOjE3MzAyODA0ODIsImFpbyI6ImsyQmdZQWc3c1dHeVZoZVQ3WHdaT1JreGp5QW5BQT09IiwiYXBwaWQiOiI1OThkNDI1NC0wNDhiLTQ2MzEtOWFkYi04NDY4ZTkyMzVhMzIiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8zMDRkODY4Yy1lMjcxLTRhOTEtODk2NS1mMjRkZWRkNzljY2YvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiIwYjI4MDE2MC05OThlLTQ4ODItOWJkOC00YTBiZDA4OTU4YmIiLCJyaCI6IjEuQVJ3QWpJWk5NSEhpa1VxSlpmSk43ZGVjendjQUFBQUFBQUFBd0FBQUFBQUFBQURPQUFBY0FBLiIsInN1YiI6IjBiMjgwMTYwLTk5OGUtNDg4Mi05YmQ4LTRhMGJkMDg5NThiYiIsInRlbmFudF9yZWdpb25fc2NvcGUiOiJOQSIsInRpZCI6IjMwNGQ4NjhjLWUyNzEtNGE5MS04OTY1LWYyNGRlZGQ3OWNjZiIsInV0aSI6InAyLWg3YTJsM2ttTlN2UFBUZzRSQUEiLCJ2ZXIiOiIxLjAiLCJ4bXNfaWRyZWwiOiI4IDcifQ.MZ01OCU7mHnTqFqjDXM7cJo8HQexKV9jazLzaO_FLF-OswNOTUYSfkERCGFKpuoDnCdcPoeB8fRZFLVrEgHklKOxgpkxELTr9i87vE-5_Hhc8GgROnOggjJt27hrR6EL9-QgUZVZw1gYNc50Kvc-RPOh8ilMlR7oHOec30BXmKHlbpm0oSZyvaAID-9FLIaKWXXyzD4xPK9g4qo7Bxz0fVpJb1Mb8y9o10Su7khOr91jOqNz5HNVNmXzIzslVZEBqH79eV3VVP5i5E-KUo-nrfmuxSJNSQGUfshW2J3XNcccgejvBp8a9vVIssBL9BS_X6mdFhkxNbs1lKjy6Fp_BA[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Cookie: ARRAffinity=fdc24e542b5d23d48207094ef629ea335496eef801a076475a9de27e667b06ef5ab954b42cfa12ad9f33ddc80a07e15dd633bd57139a65479392e46e5242529408DCF808F8779371266646687; ReqClientId=9a2bf262-a488-4e53-9ae3-f8b1bce5f9ba; orgId=aae74ad2-91b6-44ac-82ae-6298a713baa6[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "activityid: 91cb5c40-08bb-4f22-ab6c-34d2301f8705[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Accept: /[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Postman-Token: a24c4335-152b-4c63-aea1-7d8534c64070[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Accept-Encoding: gzip, deflate, br[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Content-Type: application/json[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Content-Length: 71[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Host: topnet-recette.crm4.dynamics.com[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Connection: Keep-Alive[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "{[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << " "direction": "0",[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "
"tel_num" : "73247703",[\r][\n]"[2024-10-30 09:27:58,661] DEBUG {wire}

  • HTTPS-Sender I/O dispatcher-2 << " "guid":""[\r][\n]"[2024-10-30 09:27:58,662] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "}"[2024-10-30 09:27:58,991] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "HTTP/1.1 200 OK[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Cache-Control: no-cache[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Allow: OPTIONS,GET,HEAD,POST[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Type: application/json; odata.metadata=minimal[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire}
  • HTTPS-Sender I/O dispatcher-2 >> "Content-Encoding: br[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Expires: -1[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Vary: Accept-Encoding[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Set-Cookie: ARRAffinity=fdc24e542b5d23d48207094ef629ea335496eef801a076475a9de27e667b06efeb29bb4b19df1459d2ea781b605f33064b9fea1f144b525b9d7676625c4ffb5408DCF8C0F5FD3665266646687; path=/; secure; HttpOnly[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "x-ms-service-request-id: a43cef86-de04-4952-8a06-b0db5a01324e[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "REQ_ID: a43cef86-de04-4952-8a06-b0db5a01324e[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "CRM.ServiceId: CRMAppPool[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "AuthActivityId: 6ee0d391-3657-44ab-a023-3f1a6871d564[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "x-ms-dop-hint: 48[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "x-ms-ratelimit-time-remaining-xrm-requests: 1,200.00[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "x-ms-ratelimit-burst-remaining-xrm-requests: 7999[\r][\n]"[2024-10-30 09:27:58,992] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "OData-Version: 4.0[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Source: 2202161391929254157899124520593117161611971222081891371477915820430165632710228134158[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Public: OPTIONS,GET,HEAD,POST[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Source: 60157198249183334312291322451725383015478177522359514080195737118651511775289[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Date: Wed, 30 Oct 2024 08:28:01 GMT[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Length: 400[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[0x1b][0x97][0x2][0x0][0xe4][0xb2][0xcd]^[0xff]=y[0x11][0x5]?Q[0xcb][\r][0x93][0x92][0xad][0x6][0x19][0x9a][0x8a][0x1d]\S[0xf4][\r][0x9f][0xf9][0xee]#[0x93]z[0x15][0x9c]8[0xd4]Y[0xda][0x3][\r][0xf7]f[0x8b]qD[0xbd][0x9b][0xd3][0xf2]$[0x8][0x1b][0x95]+8[0xae][0x93]Y.[0xe8][0xaf][0xdd][0xdb]s[0xe7][0xc4][0xe0]%[0x93][0xdd]T[0xe8]H[0x8b][0x5]:[0x87][0xb4]h[0xcb][0x80][0x92][0x13][0xc7]<[0x17][0xba][0x19]0[0xfc]E6M[0xa9]d[0xdb]i[0x1e]Poo[0xbd]3v[0xe8]9[0xca][0xde][0xd9][0xeb][0x3][0xc5][0xb9][0xcb][0xeb][0xf7][0xb3][0x16][0xb5][0xc3][0xe7]~][0xe1][0x99][0xb6][0xf6][0x15]?d_#x[0xb0]>[0x81][0x98][0xdf][0xf7]Z^hks[0xc6][0x1f]@[0x6]+[0x5]O[\r][0xb6][0xa6][0xc2][0xe0]e[\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[0xb2]U[0x9][0xce]jsf([0x8][0x8][0x9d][0x2]O[0x81][0xf2][0x11]@[0xf3][0x8b]Gt3~[0x1b]![0xba][0x13]+f[0x99]%[0xd5][0xc6]S[0xe0]0w[0xb0]%-[0x9f]<F[0x84][0x1f][0xaf][0xf7][0xc4]N#[0x9b][0xff][0x95]zPQ=n[0xe6]G[0xba]i[0x6][0xe6] )xb[0xd2]0 [0xb1]H[0x91]![0x4][0xe9][0x4][0x9c][0x13][0xce][0xb9][0xf1]u'[0xe][0x82][0x4]w[0x1b][0xdd][0xc3][0xb0][0xb3][0x84][0x95][0x1b][0xb8][0x85][0x6][0x9b]]t[0xd5][0x81]H[0xa0][0xfd]lw[0xe][0x82][0x0][0xbb][0x9a].I[0x93]4"[0xd8][0x15][0x82]$:[0xd2][0x84]s)[0x83]$[0xd5][0xb2]+[0x12]v[0xe7][0xce][0xec][0x0]+g[0xdd][0x8b][\n]"[2024-10-30 09:27:58,993] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[0xb2][0xbf][0x95][0x2]u[0x83]o!C[0xe5][0x97]F;[0x17]lM[0xa9] [0xcd][0xa9][0xb6]f[0xd0][0xa9][0xa5]:p[0xc7][0xa1][0xb0][0x18]T[0xdb][0x91][0x10]i[0x1c]0xf0[0xd8][0xfc]o6[0xb0][0x1]"[2024-10-30 09:27:59,000] ERROR {JsonStreamBuilder} - Error occurred while processing document for application/json java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.wso2.micro.integrator.core.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:69) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:153) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:174) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:127) at org.apache.synapse.transport.util.PassThroughMessageHandler.buildMessage(PassThroughMessageHandler.java:103) at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:155) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:96) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:242) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:825) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:324) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:644) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:219) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:304) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)Caused by: org.apache.axis2.AxisFault: #Can not parse stream. MessageID: urn:uuid:f3f4ae42-3fbb-4cb7-8cd4-22388e0a45d2. Error>>> #getNewJsonPayload. Could not save JSON payload. Invalid input stream found. Payload is not a JSON string. at org.apache.synapse.commons.json.JsonUtil.getNewJsonPayload(JsonUtil.java:888) at org.apache.synapse.commons.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:43) ... 22 moreCaused by: org.apache.axis2.AxisFault: #getNewJsonPayload. Could not save JSON payload. Invalid input stream found. Payload is not a JSON string. at org.apache.synapse.commons.json.JsonUtil.getNewJsonPayload(JsonUtil.java:872) ... 23 more [2024-10-30 09:27:59,000] ERROR {DeferredMessageBuilder} - Error building message org.apache.axis2.AxisFault at org.wso2.micro.integrator.core.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:73) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:153) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:174) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:127) at org.apache.synapse.transport.util.PassThroughMessageHandler.buildMessage(PassThroughMessageHandler.java:103) at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:155) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:96) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:242) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:825) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:324) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:644) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:219) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:304) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [2024-10-30 09:27:59,001] WARN {RelayUtils} - Server encountered an error, the request message will be consumed and discarded, , CLIENT_ADDRESS = /127.0.0.1:50430, Correlation ID = 91cb5c40-08bb-4f22-ab6c-34d2301f8705[2024-10-30 09:27:59,001] ERROR {RelayUtils} - Error while building Passthrough stream org.apache.axis2.AxisFault at org.wso2.micro.integrator.core.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:73) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:153) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:174) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:127) at org.apache.synapse.transport.util.PassThroughMessageHandler.buildMessage(PassThroughMessageHandler.java:103) at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:155) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:96) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:242) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:825) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:324) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:644) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:219) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:304) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [2024-10-30 09:27:59,001] ERROR {SequenceMediator} - {api:apicrm} Error while building message. Error while building Passthrough stream org.apache.axis2.AxisFault: Error while building Passthrough stream at org.apache.synapse.transport.passthru.util.RelayUtils.handleException(RelayUtils.java:458) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:221) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:127) at org.apache.synapse.transport.util.PassThroughMessageHandler.buildMessage(PassThroughMessageHandler.java:103) at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:155) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:96) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:242) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:825) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:324) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:644) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:219) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:304) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)Caused by: org.apache.axis2.AxisFault at org.wso2.micro.integrator.core.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:73) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:153) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:174) ... 15 more

Solution

  • It seems the backend sends data which is encoded using Brotli compression. Let's try to remove the accept-encoding header and see whether we can resolve the issue. Before calling the backend, let's add below property.

      <header action="remove" name="Accept-Encoding" scope="transport"/>