Friday, July 15, 2011

OSB and the Test Message Pattern

I want to be able to treat differently "test" messages from "normal" messages, so as to be able to monitor my application without disrupting the normal business.

Headers are very good at this.

In my test Java client:

HttpPost httppost = new HttpPost(FACADE_URL);
httppost.addHeader("ORIGIN", "TEST");

In my Facade Proxy Service, enable "get all headers".

log $inbound:

        text/plain; charset=ISO-8859-1
        Apache-HttpClient/4.1.1 (java 1.5)

The problem is how to propagate the headers to other Proxies (http or local).

Use "Set Transport Headers for outbound Destination" with the option "Pass all Headers through Pipeline" to copy the headers to the destination.
When you route to a LOCAL Proxy Service, the header changes slightly, it uses xsi:type="loc:LocalRequestHeaders" instead of xsi:type="http:HttpRequestHeaders" :


You can extract the header with


see here for a discussion on the topic, and here for OSB documentation.

No comments: