Skip to content

Instantly share code, notes, and snippets.

@mpurbo
Created May 19, 2014 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpurbo/1931add043f2deadccf1 to your computer and use it in GitHub Desktop.
Save mpurbo/1931add043f2deadccf1 to your computer and use it in GitHub Desktop.
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.messaging.support.ChannelInterceptorAdapter;
public class StompInboundChannelInterceptor extends ChannelInterceptorAdapter {
static final Log LOG = LogFactory.getLog(StompInboundChannelInterceptor.class);
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
StompHeaderAccessor headers = StompHeaderAccessor.wrap(message);
LOG.debug("I'm intercepting your message, command = " + headers.getCommand() + ", dest = " + headers.getDestination());
return message;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment