当我使用“Body to Parameter Map”转换器时,我可以获取 URL 中的参数,但无法获取内容。当我使用“JSON to Object”转换器时,我只能获取内容,但参数在有效负载中丢失。我怎样才能得到他们两个?配置如下:
<flow name="zhicall-httpFlow" doc:name="zhicall-httpFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test" encoding="UTF-8" doc:name="InHTTP" mimeType="application/json"/>
<http:body-to-parameter-map-transformer doc:name="Body to Parameter Map"/>
<json:json-to-object-transformer returnClass="java.util.Map" mimeType="application/json" doc:name="JSON to Object"/>
<!-- <http:body-to-parameter-map-transformer ignoreBadInput="true" doc:name="Body to Parameter Map" encoding="UTF-8" mimeType="application/json"/> -->
<!-- <set-property doc:name="Content-Type Property" propertyName="Content-Type" value="application/json"/> -->
<custom-transformer encoding="UTF-8" class="com.zhicall.esb.transformer.MyTransformer" doc:name="Java" mimeType="application/json"/>
</flow>