graylog-labs / graylog-plugin-mqtt

MQTT Input Plugin for Graylog
https://www.graylog.org/
13 stars 11 forks source link

Can not create two inputs for the same MQTT Server #10

Open autoantwort opened 1 year ago

autoantwort commented 1 year ago

I guess the client id used by the plugin in the same for every source. So the mqtt broker disconnects the connection constantly.

2022-12-09T01:57:28.872+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:28.872+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:28.924+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:28.924+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:28.975+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:28.975+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:29.027+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:29.027+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:29.079+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:29.079+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:29.130+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:29.130+01:00 DEBUG [ClientListener] Disconnected MQTT client
2022-12-09T01:57:29.182+01:00 WARN  [xenqtt] Connection to broker lost; scheduling a reconnect attempt for channel: MqttClientChannel[localAddress:N/A,remoteAddress:N/A]
2022-12-09T01:57:29.182+01:00 DEBUG [ClientListener] Disconnected MQTT client

If I stop one of the sources the problem disappears.

autoantwort commented 1 year ago

My guess was true: https://github.com/graylog-labs/graylog-plugin-mqtt/blob/master/src/main/java/org/graylog2/inputs/mqtt/MQTTTransport.java#L67