final Channel channel = ctx.channel();
LOG.trace("Channel {} received message type {}", channel, msgType);
switch (msgType) {
- case Constants.MSG_EMPTY_DATA:
- handleEmptyData();
- break;
- case Constants.MSG_DTC_CHUNK:
- chunks.add(msg.retain());
- break;
- case Constants.MSG_DTC_APPLY:
- handleDtcApply();
- break;
- case Constants.MSG_PING:
+ case Constants.MSG_EMPTY_DATA -> handleEmptyData();
+ case Constants.MSG_DTC_CHUNK -> chunks.add(msg.retain());
+ case Constants.MSG_DTC_APPLY -> handleDtcApply();
+ case Constants.MSG_PING -> {
LOG.trace("Received PING from Source, sending PONG");
ctx.channel().writeAndFlush(Constants.PONG);
- break;
- default:
- throw new IllegalStateException("Unexpected message type " + msgType);
+ }
+ default -> throw new IllegalStateException("Unexpected message type " + msgType);
}
}
final Channel channel = ctx.channel();
LOG.trace("Channel {} received message type {}", channel, msgType);
switch (msgType) {
- case Constants.MSG_SUBSCRIBE_REQ:
- subscribe(channel, msg);
- break;
- case Constants.MSG_PONG:
- break;
- default:
- throw new IllegalStateException("Unexpected message type " + msgType);
+ case Constants.MSG_SUBSCRIBE_REQ -> subscribe(channel, msg);
+ case Constants.MSG_PONG -> {
+ // No-op
+ }
+ default -> throw new IllegalStateException("Unexpected message type " + msgType);
}
}