broker/NettyMQTTHandler: code formatter used
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
*
|
||||
* You may elect to redistribute this code under either of these licenses.
|
||||
*/
|
||||
|
||||
package io.moquette.server.netty;
|
||||
|
||||
import io.moquette.spi.impl.ProtocolProcessor;
|
||||
@@ -22,10 +23,8 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.codec.mqtt.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static io.netty.handler.codec.mqtt.MqttQoS.AT_MOST_ONCE;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author andrea
|
||||
@@ -75,7 +74,12 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
|
||||
m_processor.processPubAck(ctx.channel(), (MqttPubAckMessage) msg);
|
||||
break;
|
||||
case PINGREQ:
|
||||
MqttFixedHeader pingHeader = new MqttFixedHeader(MqttMessageType.PINGRESP, false, AT_MOST_ONCE, false, 0);
|
||||
MqttFixedHeader pingHeader = new MqttFixedHeader(
|
||||
MqttMessageType.PINGRESP,
|
||||
false,
|
||||
AT_MOST_ONCE,
|
||||
false,
|
||||
0);
|
||||
MqttMessage pingResp = new MqttMessage(pingHeader);
|
||||
ctx.writeAndFlush(pingResp);
|
||||
break;
|
||||
@@ -99,8 +103,11 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
LOG.error(
|
||||
"An unexpected exception was caught while processing MQTT message. Closing Netty channel. MqttClientId = {}, cause = {}, errorMessage = {}.",
|
||||
NettyUtils.clientID(ctx.channel()), cause.getCause(), cause.getMessage());
|
||||
"An unexpected exception was caught while processing MQTT message. "
|
||||
+ "Closing Netty channel. MqttClientId = {}, cause = {}, errorMessage = {}.",
|
||||
NettyUtils.clientID(ctx.channel()),
|
||||
cause.getCause(),
|
||||
cause.getMessage());
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user