ARTEMIS-1685 Set MQTT connection clientID before session creation

This commit is contained in:
Dejan Bosanac 2018-02-16 15:49:10 +01:00 committed by Clebert Suconic
parent e5ef7d37ae
commit 1f06ec07e6
1 changed files with 1 additions and 1 deletions

View File

@ -76,6 +76,7 @@ public class MQTTConnectionManager {
session.setSessionState(getSessionState(clientId));
String password = passwordInBytes == null ? null : new String(passwordInBytes, CharsetUtil.UTF_8);
session.getConnection().setClientID(clientId);
ServerSessionImpl serverSession = createServerSession(username, password);
serverSession.start();
@ -93,7 +94,6 @@ public class MQTTConnectionManager {
session.getConnection().setConnected(true);
session.start();
session.getConnection().setClientID(clientId);
session.getProtocolHandler().sendConnack(MqttConnectReturnCode.CONNECTION_ACCEPTED);
}