diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/AbstractMQTTSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/AbstractMQTTSocket.java index 48282d999d..a3e5bf1a3a 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/AbstractMQTTSocket.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/AbstractMQTTSocket.java @@ -144,8 +144,9 @@ public abstract class AbstractMQTTSocket extends TransportSupport implements MQT if (protocolConverter == null) { synchronized(this) { if (protocolConverter == null) { - protocolConverter = new MQTTProtocolConverter(this, brokerService); - IntrospectionSupport.setProperties(protocolConverter, transportOptions); + MQTTProtocolConverter newProtocolConverter = new MQTTProtocolConverter(this, brokerService); + IntrospectionSupport.setProperties(newProtocolConverter, transportOptions); + protocolConverter = newProtocolConverter; } } }