use of org.apache.activemq.artemis.core.remoting.impl.netty.NettyServerConnection in project activemq-artemis by apache.
the class MQTTProtocolManager method createConnectionEntry.
@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection) {
try {
MQTTConnection mqttConnection = new MQTTConnection(connection);
ConnectionEntry entry = new ConnectionEntry(mqttConnection, null, System.currentTimeMillis(), MQTTUtil.DEFAULT_KEEP_ALIVE_FREQUENCY);
NettyServerConnection nettyConnection = ((NettyServerConnection) connection);
MQTTProtocolHandler protocolHandler = nettyConnection.getChannel().pipeline().get(MQTTProtocolHandler.class);
protocolHandler.setConnection(mqttConnection, entry);
return entry;
} catch (Exception e) {
log.error(e);
return null;
}
}
Aggregations