How to Solve Message payload is of type: BufferInputStream Exception in Mule

三世轮回 提交于 2019-12-03 13:38:37
afelisatti

It seems you are getting a 400 status code from the HTTP request which is causing an exception before even reaching the transformer. Try adding a success-status-code-validator that covers all of the cases (you can choose which ones to consider later):

<http:request parseResponse="false" config-ref="HTTP_Request_Configuration" host="#[flowVars.destination]" port="80" path="/" method="POST">
        <http:success-status-code-validator values="0..599"/>
    </http:request>

I also got this error when posting a status update using twitter mulesoft adapter, though after some googling & trial, I figured out that error is not with the adapter, it is with the payload string passed to the adapter.

In the SetPayload try this expression in the value field: #['RT @' + message.payload[0].user.screenName + ':' + message.payload[0].text]

And in the twitter adapter try these values:

Operation: Update status Status: #[payload]

If still you get an error, there may be some special characters in the "message.payload[0].text" which is the last tweet of the screenName, either try putting a logger without the update status adapter and check if you can log it correctly.

Thanks Madajee. I had the same issue and your answer helped me to resolve it. Also, to add to this, there are issues with Twitter access that must be looked into in conjunction to ensure that you have a working solution. Especially around changing the permission to DT (Direct Tweet) and regenerating the Access Key and re-entering it in your Twitter connector config.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!