gateway.addMessageListener(new IDontNeedSecurity());
gateway.addMessageListener(new ClientMessageValidationListener());
NettyConnectedMessageListener cml = new NettyConnectedMessageListener();
cml.setHeartbeatContainer(heartbeatContainer);
cml.setGateway(gateway);
gateway.addMessageListener(cml);
NettyDisconnectListenerAndInterceptor disconnect = new NettyDisconnectListenerAndInterceptor();
disconnect.setCloseOnDisconnectMessage(false);
gateway.addMessageListener(disconnect);