Created
July 24, 2015 15:29
-
-
Save azare/fe8d83b973013ab1bf5b to your computer and use it in GitHub Desktop.
Outbound Interceptor to rewrite the response status code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OutboundHttpStatusCodeInterceptor extends AbstractPhaseInterceptor<Message> { | |
public OutboundHttpStatusCodeInterceptor() { | |
super(Phase.SEND); | |
} | |
@Override | |
public void handleMessage(Message message) { | |
if (ServiceContext.get().isHttpStatusCodeValueOverridden()) { | |
message.put(Message.RESPONSE_CODE, ServiceContext.get().getHttpStatusCodeValue()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment