Closed loleek closed 10 months ago
Config file is easier to be shared between streams instead of configuring each time. When adding graph API, the only option is to use this config files otherwise, there is a lot of architecture to make. We may change the connection, source configure related API in v2 version which allow breaking changes.
@loleek Currently, the source configuration can be changed in props field. Here is an example:
{
"id": "rule1",
"name": "simple rule",
"graph": {
"nodes": {
"demo": {
"type": "source",
"nodeType": "mqtt",
"props": {
"datasource": "demo",
"timestamp": "ts",
"server": "tcp://syno.home:1883"
}
},
"filter": {
"type": "operator",
"nodeType": "filter",
"props": {
"expr": "temperature > 30"
}
},
"log": {
"type": "sink",
"nodeType": "log",
"props": {}
}
},
"topo": {
"sources": [
"demo"
],
"edges": {
"demo": [
"filter"
],
"filter": [
"log"
]
}
}
}
}
Thanks. I will try it. Does the mqtt username and password change in the same way?
Here's a confuse about why not allow inject source configurations from graph rule in props field. For example, if I create a mqtt source in graph rule, I cannot set server / username / password in props field, but given a conf_key or use default config from etc/mqtt_source.yaml? Thanks.