Skip to content

Instantly share code, notes, and snippets.

@azare
Created July 24, 2015 15:29
Show Gist options
  • Save azare/fe8d83b973013ab1bf5b to your computer and use it in GitHub Desktop.
Save azare/fe8d83b973013ab1bf5b to your computer and use it in GitHub Desktop.
Outbound Interceptor to rewrite the response status code
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