Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT consumer plugin connected to ActiveMQ Artemis broker but no subscriptions created #9736

Closed
jenrg opened this issue Sep 8, 2021 · 2 comments
Labels
area/mqtt bug unexpected problem or unintended behavior

Comments

@jenrg
Copy link

jenrg commented Sep 8, 2021

Seems like Telegraf MQTT Consumer Input Plugin does not actually subscribe to any topic when connecting to ActiveMQ Artemis broker.

I'm using ActiveMQ Artemis as MQTT broker and successfully receiving messages from a producer to a topic (or in case of Artemis, an address with multicast routing). I tested subscribing and receiving messages successfully with a simple Python script using paho-mqtt (see attached gists for script source and Artemis logs) so the broker does work exactly as expected. Subscription queues are created and messages flow correctly.

Now I installed Telegraf and tried to consume the same topic with same QoS, same user etc. but the broker does not even receive the subscription event from Telegraf MQTT Consumer Input Plugin, not to mention any messages. The connection is established successfully and the plugin creates 2 sessions and pings the broker every now and then but it does not actually subscribe to the configured topic.

Relevant telegraf.conf:

[[inputs.mqtt_consumer]]
   servers = ["tcp://localhost:1883"]
   topics = [
     "topic/test",
   ]
   topic_tag = "topic"
   qos = 1
   max_undelivered_messages = 100
   persistent_session = false
   client_id = "telegraf"
   username = "user"
   password = "pass"
   data_format = "influx"

System info:

OS: Ubuntu 20.04.3 LTS
Telegraf: 1.19.3-1 from https://repos.influxdata.com/ubuntu focal stable
ActiveMQ Artemis: 2.18.0

Steps to reproduce:

  1. install ActiveMQ Artemis with default settings
  2. set up some MQTT client producing messages to a topic (or do this manually through Artemis UI)
  3. install Telegraf
  4. configure MQTT Consumer Input Plugin (see config above)
  5. restart Telegraf

Expected behavior:

Telegraf MQTT Consumer Input Plugin creates a durable subscription on the topic and starts receiving messages

Actual behavior:

Telegraf MQTT Consumer Input Plugin does NOT create any subscriptions and thus does not receive any messages

Additional info:

Python script used to successfully test topic subscription on the target broker
https://gist.github.com/jenrg/e2631f0cc6f4adb2ebec2056276dfca1

ActiveMQ Artemis log from successful subscription by the Python script
https://gist.github.com/jenrg/7877ba9c9d0149345fc7b7985bed5889

Telegraf log output
https://gist.github.com/jenrg/d9722c053ff2aa327116b8a4e573e54f

ActiveMQ Artemis log from Telegraf connection created but no subscriptions
https://gist.github.com/jenrg/df180b761af1c993eaf2391c3c376734

@jenrg jenrg added the bug unexpected problem or unintended behavior label Sep 8, 2021
@reimda
Copy link
Contributor

reimda commented Apr 25, 2022

Hi @jenrg were you able to find a way to get this working? I noticed that Artemis was mentioned in #7735 as possibly working with Telegraf.

If not, are you able to contribute a PR to fix the issue? Thanks!

@jenrg
Copy link
Author

jenrg commented Apr 27, 2022

No I didn't. I actually switched to using a completely different solution to process Artemis queues so I'm sorry but I'm not able to help with this issue.

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mqtt bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants