Service Routing
One thing you'll often need to do when developing services, is to develop a new version while keeping the old version running. This guide shows how to develop a simple service router that will scan the incoming message then direct the message to the appropriate service version.
...
- The MediatorInInterceptor is for SOAP binding, you can write a similar interceptor for XML binding etc.
- We call chain.abort at the end of this interceptor to stop any further processing in the dummy service.
- In this example, implementor1 and implementor2 are published using local transport. This is achieved by using an address like "local://SoapContext/version1/SoapPort". The MediatorInInterceptor looks up ServerRegistry to find endpoints hosted in the server then does the re-dispatch.
- The MediatorInInterceptor is set to POST_STREAM phase and before StaxInInterceptor, this makes sure it is the very first interceptor to be invoked.