wso2esb - HTTP请求的冗余头

时间:2016-09-01 12:26:46

标签: rest rabbitmq wso2esb

我在WSO2 ESB中编写了一个简单的代理来处理HTTP请求并向RabbitMQ队列发送消息。 这是我的代理服务:

<?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&amp;rabbitmq.server.port=5672&amp;rabbitmq.server.user.name=test&amp;rabbitmq.server.password=test&amp;rabbitmq.queue.name=inputQueue_001&amp;rabbitmq.exchange.name=amq.direct&amp;rabbitmq.queue.routing.key=inputQueue_001&amp;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>

从几天开始,我一直在努力将邮件从邮件发送到队列中删除。 这是我在inputQueue_001上的消息:

enter image description here

我不知道如何删除所有标题...

你有任何线索???

我将不胜感激任何帮助和例子。

1 个答案:

答案 0 :(得分:2)

所有传输头都保存在axis2消息上下文中,名为TRANSPORT_HEADERS的属性中:在发送中介之前将其删除

doubleValue()