Code Monkey home page Code Monkey logo

Comments (4)

jpmens avatar jpmens commented on July 17, 2024

I think we use exec() and not shell, so no, that wouldn't work.

If you'll pardon my question? What on earth are you doing? ;-) A subscribe when a publish occurs in order to publish it? I had to wrap my head around that one ...

What are you attempting to accomplish?

from mqtt-launcher.

jeremyj avatar jeremyj commented on July 17, 2024

@jpmens I can understand your confusion :-)
I have this setup:

remote clients -> remote broker 1 <--bridge--> local broker
remote clients -> remote broker 2 <--bridge--> local broker
remote clients -> remote broker 3 <--bridge--> local broker

The assumption is that I cannot query the remote brokers directly (nor do I want to since I would like the setup to be agnostic).

I need to know from my local broker how many clients are connected to each of my remote brokers.

With my "twisted" setup I issue a publish on my local broker which is bridged to all my remote brokers so that mqtt-launcher queries the remote brokers locally and publishes the results on an identifiable topic which is then bridged back to my local broker.

I tried configuring mqtt-launcher with a local payload that triggers a mosquitto_sub -t $SYS/broker/clients/connected on the remote broker and reading the output from the report topic on the local broker. But I have no way of associating the output to the remote broker.

I pretty new to MQTT so I'm sure there's a better way of doing this. Any suggestion would be much appreciated :-)

from mqtt-launcher.

jpmens avatar jpmens commented on July 17, 2024

My head hurts. :-)

I think this is the main sentence:

I need to know from my local broker how many clients are connected to each of my remote brokers.

What I'd do is brigde in the appropriate $SYS/ branch of the remote broker into a broker-specific branch on your local broker; you can then query the values locally. Look around this topic

$SYS/broker/clients/connected 751

from mqtt-launcher.

jeremyj avatar jeremyj commented on July 17, 2024

Ah, I totally overlooked topic remapping.
Thanks for the tip!

from mqtt-launcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.