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

VerneMQ vmq_bridge feature #2178

Open
ankitshah197 opened this issue Aug 3, 2023 · 10 comments
Open

VerneMQ vmq_bridge feature #2178

ankitshah197 opened this issue Aug 3, 2023 · 10 comments

Comments

@ankitshah197
Copy link

Requirement

Forward all the messages from Machine A to Machine B. I have configured bridge in Machine B. Below is my .conf file

plugins.vmq_bridge = on
vmq_bridge.tcp.br0 = "some address due to privacy":1883
vmq_bridge.tcp.br0.cleansession = on
vmq_bridge.tcp.br0.client_id = BridgeMM
vmq_bridge.tcp.br0.keepalive_interval = 60
vmq_bridge.tcp.br0.username = user
vmq_bridge.tcp.br0.password = password
vmq_bridge.tcp.br0.topic.1 = * in
vmq_bridge.tcp.br0.restart_timeout = 10
vmq_bridge.tcp.br0.try_private = off
vmq_bridge.tcp.br0.max_outgoing_buffered_messages = 1000

Expected behavior

When I connect to Machine B (Mqtt://Ipaddress:1883), I can see all the messages of Machine A into Machine B.

Actual behaviour

I can see all the messages of Machine A with username "user" and password "password" while connecting it via MQTT explorer. But I can not see any message in Machine B.

@ioolkos
Copy link
Contributor

ioolkos commented Aug 3, 2023

Please check the log files on both sides. Is the bridge able to connect? (is A reachable on a network level from B?).
What does vmq-admin bridge show display if called on B?


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@ankitshah197
Copy link
Author

ankitshah197 commented Aug 3, 2023

Hello @ioolkos, many thanks for comment.

This is the logs from machine B

2023-08-03 14:41:52 09:11:52.968 [info] Bridge br0 connected to IpAddress:1883.
2023-08-03 14:41:53 09:11:53.114 [info] Bridge Pid <0.647.0> is subscribing to Topics: [{[<<"#">>],0}]

$ vmq-admin bridge show

> +------+-------------------+-------------+------------+---------------------+--------------------------+
> | name | endpoint          | buffer size | buffer max | buffer dropped msgs | MQTT process mailbox len |
> +------+-------------------+-------------+------------+---------------------+--------------------------+
> | br0  | IPAddress:1883 | 0           | 1000       | 0                   | 0                        |
> +------+-------------------+-------------+------------+---------------------+--------------------------+
> ```

This what it desplay in machine B



@ioolkos
Copy link
Contributor

ioolkos commented Aug 3, 2023

This should work, yes.
How do you subscribe on B? note that you'll need a B-specific username/password to subscribe there, not the bridge username.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@ankitshah197
Copy link
Author

ankitshah197 commented Aug 3, 2023

Yes I have verified the username and password at B-end is correct. No problem in that, because I can connect with the user name and passowrd in Machine B, only can not see the Machine A messages.

Any suggestion?

@ankitshah197
Copy link
Author

Hi @ioolkos

Somehow I find the problem, this cause the problem to me.

listener.tcp.default = 0.0.0.0:1883
listener.tcp.default.mountpoint = abc
listener.tcp.platform = 0.0.0.0:1884
listener.tcp.platform.mountpoint = xyz
listener.tcp.lora = 0.0.0.0:1885
listener.tcp.lora.mountpoint = lora

listener.ssl.default = 0.0.0.0:8883
listener.ssl.default.mountpoint = abc
listener.ssl.platform = 0.0.0.0:8884
listener.ssl.platform.mountpoint = xyz
listener.ssl.lora = 0.0.0.0:8885
listener.ssl.lora.mountpoint = lora

When I configured above values in .conf file, it's not working at all. But when I change it to like below it's working

listener.tcp.name = 127.0.0.1:1883

But I want above configuration file to be placed.

@ioolkos
Copy link
Contributor

ioolkos commented Aug 10, 2023

@ankitshah197 this doesn't look like a Verne issue to me. Maybe some connectivity thing on a Docker level?


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@ankitshah197
Copy link
Author

ankitshah197 commented Aug 10, 2023

Hi @ioolkos

It seems like problem in mountpoint. When I removed some of the line from below, it's started working

listener.tcp.default = 0.0.0.0:1883

******** Removed *********************
listener.tcp.default.mountpoint = abc
listener.tcp.platform = 0.0.0.0:1884
listener.tcp.platform.mountpoint = xyz
listener.tcp.lora = 0.0.0.0:1885
listener.tcp.lora.mountpoint = lora


listener.ssl.default = 0.0.0.0:8883

******** Removed *********************
listener.ssl.default.mountpoint = abc
listener.ssl.platform = 0.0.0.0:8884
listener.ssl.platform.mountpoint = xyz
listener.ssl.lora = 0.0.0.0:8885
listener.ssl.lora.mountpoint = lora


After that I checked #205 and it seems like brige plugin currently only support the default mountpoint "", so the message are never picked up by the bridge.

Do you have any update on this? It seems that the above issue from 2016, there could be lot change after that.

@ioolkos
Copy link
Contributor

ioolkos commented Aug 10, 2023

@ankitshah197 apologies, I didn't catch you configured mountpoints. In Verne, mountpoints separate message traffic.
So, if the bridge connects to 1883, it should pick up the messages coming in from clients connected to 1883. Is that not what you see?


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@ankitshah197
Copy link
Author

ankitshah197 commented Aug 10, 2023

Yes, that should be expected behaviour. But that's not happening.

@ioolkos
Copy link
Contributor

ioolkos commented Aug 10, 2023

Must look into it. Thanks for verifying and reporting this!


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants