Error sending HTTP request. Message payload is of type: LinkedHashMap [MULE ESB] -


i'm new in mule esb, have code , i'm trying sending http request using http:request following format:

"http: //www.host.com/api/commentthreads?key=val&part=val2&..."

    <file:inbound-endpoint  connector-ref="fileconnector" path="c:/tmp/input"                              doc:name="reader file configuration" responsetimeout="10000"                              encoding="utf-8" mimetype="text/plain"                             pollingfrequency="20000">         <file:filename-wildcard-filter pattern="*.json"/>     </file:inbound-endpoint>      <json:json-to-object-transformer returnclass="java.util.map" doc:name="json object"/>      <logger level="info" message="#[payload]" doc:name="logger" />      <http:request config-ref="http_request_configuration" path="/commentthreads" method="get" port="443" doc:name="http request">         <http:request-builder>             <http:query-param paramname="key" value="#[message.payload.key]"/>             <http:query-param paramname="allthreadsrelatedtochannelid" value="#[message.payload.allthreadsrelatedtochannelid]"/>             <http:query-param paramname="part" value="#[message.payload.part]"/>         </http:request-builder>     </http:request> 

but i'm having error:

  • message : error sendinbut g http request. message payload of type: linkedhashmap
  • code : mule_error--2

exception stack is:

  1. null (java.util.concurrent.timeoutexception) org.glassfish.grizzly.impl.safefutureimpl$sync:357 (null)
  2. error sending http request. message payload of type: linkedhashmap (org.mule.api.messagingexception)
    org.mule.module.http.internal.request.defaulthttprequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/messagingexception.html)

the question how can make http request format using map?

according documents

https://www.mulesoft.org/documentation/display/current/http+request+connector#httprequestconnector-httprequestbody

the mule message payload converted byte array , sent http request's body. behavior carried out always, except in following scenarios:

the mule message's payload map of keys , values

generate request body content-type:application/x-form-urlencoded

whenever message payload map, connector automatically generates http request header content-type:application/x-www-form-urlencoded. keys , values of map in payload converted form parameter keys , values in body of http request.

i suppose map converter automatically request. correct me if i'm wrong

it necessary make transformation before

<json: json-to-object-transformer returnclass = "java.util.map" doc: name = "json object" /> 

it corrected putting

<byte-array-to-string-transformer doc: name = "byte array string" /> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -