{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

Route messages based on HTTP Headers with WSO2 ESB

The following code can be used to route messages based on HTTP Headers in the WSO2 Enterprise Service Bus.

<proxy xmlns="http://ws.apache.org/ns/synapse" name="test1" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
         <log level="custom">
            <property name="log" expression="get-property('transport','Accept')" />
         <filter xmlns:ns="http://org.apache.synapse/xsd" source="get-property('transport','Accept')" regex="text/html">
               <log level="custom">
                  <property name="test" value="text/html" />
               <sequence key="sequence1" />
               <log level="custom">
                  <property name="test" value="other" />
               <sequence key="sequence2" />
               <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap12" />
         <send />

More details available at [1]

[1] http://wso2.org/project/esb/java/4.0.3/docs/samples/proxy_samples.html#Sample157 

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks