Visualize communication between producers and consumers #4865
-
Hello everyone, is it possible retrieve information which producer sends a msg to an exchange and how many consumers are listening on the queue that gets the msg from the exchange? I can use Elixir or Erlang for this task, so maybe there is a plugin based solution? I try to visualize these communication streams in a .dot graph with graphviz. I'm really thankful for any input. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
In the simplest case, this could probably be retrieved from the exchange/queue/channel metrics. However, this would break as soon as you have more things going on because there is no per message tracing. For example, with two publishers publishing to the same exchange/queue and two consumers consuming from the that queue, we could for example tell that each publisher published 1 messages and each consumer received one message, but we wouldn't be able to tell, based purely on metrics, which consumer received which message. Things complicate even further with fan-out exchanges, messages unacked by consumers and therefore returned to the queue and perhaps delivered to another consumers, etc. If your goal is to trace a message in a production env, this is something @deadtrickster has some interest in I believe but it's not something you can really do right now. If your goal is to build a tool to visualize this in a controlled environment, you'd need to include some IDs in the headers and/or payload to be able to trace where a given message was routed and delivered. Some distributed tracing tools already support RabbitMQ by injecting SPAN IDs into the headers but I can't personally say much more about that. |
Beta Was this translation helpful? Give feedback.
In the simplest case, this could probably be retrieved from the exchange/queue/channel metrics. However, this would break as soon as you have more things going on because there is no per message tracing. For example, with two publishers publishing to the same exchange/queue and two consumers consuming from the that queue, we could for example tell that each publisher published 1 messages and each consumer received one message, but we wouldn't be able to tell, based purely on metrics, which consumer received which message. Things complicate even further with fan-out exchanges, messages unacked by consumers and therefore returned to the queue and perhaps delivered to another consumers, etc.…