Reputation: 3224
I have written a simple proxy in WSO2 ESB to just handle HTTP request and send message to RabbitMQ queue. Here's my proxy service:
<?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>
From few days I am struggling with removing headers from message send to queue. Here's my message on inputQueue_001:
and I have no idea how to remove all headers...
Do you have any clues???
I will appreciate any help and examples.
Upvotes: 3
Views: 1211
Reputation: 5946
All transport headers are saved in axis2 message context, in a property named TRANSPORT_HEADERS : delete it before send mediator
<property action="remove" name="TRANSPORT_HEADERS" scope="axis2"/>
Upvotes: 4