...
Before digging into implementation details, let's take a look at the co-relation of the example scenario and the Message Filter EIP by comparing their core components.
Message Filter EIP (Figure 1) | Message Filter Example Scenario (Figure 2) |
---|---|
Quote | Stock Quote Request |
Message Filter | Filter Mediator is used to filter the content of the incoming message |
Environment setup
- Download and install WSO2 ESB from http://wso2.com/products/enterprise-service-bus. For a list of prerequisites and step-by-step installation instructions, see Installation Guide in the WSO2 ESB documentation.
- Start a sample Axis2 server instance on port 9000. For instructions, see Setting up the ESB Samples - Starting the Axis2 server in the WSO2 ESB documentation.
...
- Send a request using the Stock Quote client to WSO2 ESB in the following manner. For information about the Stock Quote client, see Sample Clients in the WSO2 ESB Documentation.
ant stockquote -Dtrpurl=http://localhost:8280/services/MessageFilterProxy -Dsymbol=foo
- After executing the above command through the client, observe that the request is transferred to the foo inventory service and a response is received. If the
-Dsymbol
parameter was changed to another value, there will be no response.The structure of the request is as follows:
Code Block language html/xml linenumbers true <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd"> <soapenv:Header/> <soapenv:Body> <ser:getQuote> <!--Optional:--> <ser:request> <!--Optional:--> <ser:symbol>foo</ser:symbol> </ser:request> </ser:getQuote> </soapenv:Body> </soapenv:Envelope>
...