wso2esb - 来自 HTTP 请求的冗余 headers
wso2esb - redundant headers from HTTP request
我在 WSO2 ESB 中编写了一个简单的代理来处理 HTTP 请求并将消息发送到 RabbitMQ queue。
这是我的代理服务:
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="TestProxy" startOnLoad="true" transports="https http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<header action="remove" name="Accept" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="default"/>
<property action="remove" name="SOAP_ACTION" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="axis2"/>
<property action="remove" name="SOAPAction" scope="default"/>
<property action="remove" name="SOAPAction" scope="transport"/>
<property action="remove" name="SOAPAction" scope="axis2"/>
<header action="remove" name="Action" scope="default"/>
<header action="remove" name="Action" scope="transport"/>
<property name="transport.jms.ContentTypeProperty" scope="axis2" type="STRING" value="Content-Type2"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="CONTENT_TYPE" value="application/json" scope="axis2"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true" />
<payloadFactory media-type="json">
<format>{"test": "test2"}</format>
<args>
</args>
</payloadFactory>
<send>
<endpoint>
<address trace="disable"
uri="rabbitmq:/TestProxy?rabbitmq.server.host.name=localhost&rabbitmq.server.port=5672&rabbitmq.server.user.name=test&rabbitmq.server.password=test&rabbitmq.queue.name=inputQueue_001&rabbitmq.exchange.name=amq.direct&rabbitmq.queue.routing.key=inputQueue_001&rabbitmq.message.content.type=application/json"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<header action="remove" name="Accept" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="default"/>
<property action="remove" name="SOAP_ACTION" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="axis2"/>
<property action="remove" name="SOAPAction" scope="default"/>
<property action="remove" name="SOAPAction" scope="transport"/>
<property action="remove" name="SOAPAction" scope="axis2"/>
<header action="remove" name="Action" scope="default"/>
<header action="remove" name="Action" scope="transport"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<send></send>
</outSequence>
<faultSequence/>
</target>
</proxy>
几天来,我一直在努力从发送到 queue 的消息中删除 headers。
这是我在 inputQueue_001 上的消息:
我不知道如何删除所有 headers...
你有什么线索吗???
我将不胜感激任何帮助和示例。
所有传输 headers 都保存在 axis2 消息上下文中,在名为 TRANSPORT_HEADERS 的 属性 中:在发送中介之前将其删除
<property action="remove" name="TRANSPORT_HEADERS" scope="axis2"/>
我在 WSO2 ESB 中编写了一个简单的代理来处理 HTTP 请求并将消息发送到 RabbitMQ queue。 这是我的代理服务:
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="TestProxy" startOnLoad="true" transports="https http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<header action="remove" name="Accept" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="default"/>
<property action="remove" name="SOAP_ACTION" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="axis2"/>
<property action="remove" name="SOAPAction" scope="default"/>
<property action="remove" name="SOAPAction" scope="transport"/>
<property action="remove" name="SOAPAction" scope="axis2"/>
<header action="remove" name="Action" scope="default"/>
<header action="remove" name="Action" scope="transport"/>
<property name="transport.jms.ContentTypeProperty" scope="axis2" type="STRING" value="Content-Type2"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="CONTENT_TYPE" value="application/json" scope="axis2"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true" />
<payloadFactory media-type="json">
<format>{"test": "test2"}</format>
<args>
</args>
</payloadFactory>
<send>
<endpoint>
<address trace="disable"
uri="rabbitmq:/TestProxy?rabbitmq.server.host.name=localhost&rabbitmq.server.port=5672&rabbitmq.server.user.name=test&rabbitmq.server.password=test&rabbitmq.queue.name=inputQueue_001&rabbitmq.exchange.name=amq.direct&rabbitmq.queue.routing.key=inputQueue_001&rabbitmq.message.content.type=application/json"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<header action="remove" name="Accept" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="default"/>
<property action="remove" name="SOAP_ACTION" scope="transport"/>
<property action="remove" name="SOAP_ACTION" scope="axis2"/>
<property action="remove" name="SOAPAction" scope="default"/>
<property action="remove" name="SOAPAction" scope="transport"/>
<property action="remove" name="SOAPAction" scope="axis2"/>
<header action="remove" name="Action" scope="default"/>
<header action="remove" name="Action" scope="transport"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<send></send>
</outSequence>
<faultSequence/>
</target>
</proxy>
几天来,我一直在努力从发送到 queue 的消息中删除 headers。 这是我在 inputQueue_001 上的消息:
我不知道如何删除所有 headers...
你有什么线索吗???
我将不胜感激任何帮助和示例。
所有传输 headers 都保存在 axis2 消息上下文中,在名为 TRANSPORT_HEADERS 的 属性 中:在发送中介之前将其删除
<property action="remove" name="TRANSPORT_HEADERS" scope="axis2"/>