2

I'm using ActiveMQ 5.11.1 which is configured with mqtt over websocket.

Is it possible to disconnect old mqtt connection with same client Id in server side if new connection is came with same client Id?

When I tried this scenario by using hivemq websocket, I'm getting error message as follows.

2015-06-18 20:03:06,074 | WARN | Transport Connection to: MQTTSocket_22078239 failed: java.io.IOException: Broker: localhost - Client: abc already connected from MQTTSocket_24236395 | org.apache.activemq.broker.TransportConnection.Transport | qtp20829588-40

john
  • 2,054
  • 4
  • 20
  • 25

1 Answers1

1

For the WS Connector in ActiveMQ you need to enable the allowLinkStealing option

ws://0.0.0.0:61614?allowLinkStealing=true

This defaults to on for normal MQTT based transport connectors but because the WS transport connector must serve multiple protocol connections (STOMP and MQTT) the default is off.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • It's not working. a first tcp/ip connection is still alive even if a second client with the same clientId connects.`jvm 1 | WARN | Stealing link for clientId abc From Connection Transport Conn ection to: MQTTSocket_12700349` – john Jun 19 '15 at 02:26
  • FYI, [mosquitto](http://mosquitto.org/) and [emqttd](http://emqtt.io/) are works in this scenario. – john Jun 19 '15 at 02:35
  • I doubt that bug reports on StackOverflow will get you very far, recommend you open an issue with ActiveMQ project. – Tim Bish Jun 19 '15 at 14:59