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

Forwarding client data with client info #113

Open
berayb opened this issue Nov 4, 2020 · 3 comments
Open

Forwarding client data with client info #113

berayb opened this issue Nov 4, 2020 · 3 comments

Comments

@berayb
Copy link

berayb commented Nov 4, 2020

Currently forwarding all data with the following config:
$share/${group_id}/+

However, this only yields the data itself. Which syntax would also include the client information?

Thanks,

@HJianBo
Copy link
Member

HJianBo commented Nov 5, 2020

Hi @berayb In the emqx-bridge-mqtt plugin, It doesn't get any information from the sender.

But, in the Rule-Engine, you can get at most the username and clientid of the sender. Here are an example data in the Rule-Engine:

##SQL
SELECT
  *
FROM
  "t/#"

## Results
{
  "username": "u_emqx",
  "topic": "t/a",
  "timestamp": 1604539001555,
  "qos": 1,
  "publish_received_at": 1604539001555,
  "peerhost": "127.0.0.1",
  "payload": "{\"msg\":\"hello\"}",
  "node": "052dd2278bc0@172.17.0.2",
  "metadata": {
    "rule_id": "test_rule5f78c83d"
  },
  "id": "5B351D9374ABC18AC0000077F0000",
  "flags": {
    "sys": true,
    "event": true
  },
  "clientid": "c_emqx"
}

And you can pick up some field of this, then Republish it with Republish Action Handler

@berayb
Copy link
Author

berayb commented Nov 21, 2020

Thanks, @HJianBo. Moving to rules for typical data flow is on our roadmap. However, is it possible to add client id into the classic bridge method? This might be a quite helpful feature.

@HJianBo
Copy link
Member

HJianBo commented Nov 23, 2020

Don't worry, I believe that bridging data to MQTT-Broker in Rule-Engine is also fully supported by your bridging needs!

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