jchannel.setDiscardOwnMessages(true);
ControlChannel control = new ControlChannel(jchannel);
control.setDiscardOwnMessages(true);
jchannel.setReceiver(new ReceiverAdapter() {
@Override
public void receive(Message msg) {
log.info("received: {} headers: {} content: {}", new Object[]{msg, msg.getHeaders(), msg.getObject()});
}
});
control.setReceiver(new ReceiverAdapter() {
@Override
public void receive(Message msg) {
log.info("CONTROL received: {} headers: {} content: {}", new Object[]{msg, msg.getHeaders(), msg.getObject()});
}