0

I have an ActiveMQ broker and data is coming to the queue inside this broker.

I am trying to read the data from the same broker but I am not able to read the data.

Below I have given my telegraf configuration. I have provided the topic name. I tried creating a topic and sending custom data and that data I am able to read properly.

[[inputs.mqtt_consumer]]
  servers = ["provided"]
  qos = 0

  ## Topics that will be subscribed to.

  topics = [

    "topic_name",

  ]
  connection_timeout = "30s"
  ## If unset, a random client ID will be generated.
   client_id = "telegraf"
  ## Username and password to connect MQTT server.
  username = "provided"
  password = "provided"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

[[inputs.activemq]]

  ## ActiveMQ WebConsole URL
  url = "provided"
  ## Required ActiveMQ Endpoint
  ##   deprecated in 1.11; use the url option
  # server = "192.168.50.10"
  # port = 8161
  ## Credentials for basic HTTP authentication
   username = "provided"
  password = "provided"


[[outputs.file]]

##   ## Files to write to, "stdout" is a specially handled file.

  files = ["stdout","/etc/telegraf/metrics.out"]

The data coming from devices is going to the queue, not the topic.

enter image description here

As you can see the data is present inside the queue. so now coming to my main question how I can read the data from the queue not from the topic using telegraf?

Ravi kant Gautam
  • 333
  • 2
  • 23

1 Answers1

0

MQTT supports topics by default. You either need to change your message flow to publish to topics, or configure your ActiveMQ broker to use Virtual Topic Subscription Strategy for MQTT (where messages are stored in queues).

ref: https://activemq.apache.org/mqtt

Note: Please edit your post to hide your broker URL and admin password!

Matt Pavlovich
  • 4,087
  • 1
  • 9
  • 17