Hi,
I installed oss 2.11 and rabbitmq (mqtt enabled) with docker (influxdb:latest and influxdb:alpine).
I tried to use the experimental api
mqtt.to
but I have the following error
runtime error @8:6-15:4: map: failed to evaluate map function: Dialer.Dial called on an error dependency
this is the query that I use
import "array"
import "experimental/mqtt"
array.from(rows: [
{_measurement: "foo", _time: 2020-01-01T00:00:11Z, _field: "temp", _value: 1.0, loc: "eu"},
{_measurement: "foo", _time: 2020-01-01T00:00:11Z, _field: "temp", _value: 2.0, loc: "us"},
])
|> group(columns: ["_measurement", "field", "loc"])
|> map(fn: (r) => ({ r with sent:
mqtt.publish(
broker: "tcp:localhost:1883",
username: "rabbitmq",
password: "rabbitmq",
topic: "test",
message: "message") })
)
and with mqtt.to the message is not published
import "array"
import "experimental/mqtt"
array.from(rows: [
{_measurement: "foo", _time: 2020-01-01T00:00:11Z, _field: "temp", _value: 2.0, loc: "us"},
{_measurement: "foo", _time: 2020-01-01T00:00:21Z, _field: "temp", _value: 1.0, loc: "us"},
{_measurement: "foo", _time: 2020-01-01T00:00:31Z, _field: "temp", _value: 3.0, loc: "us"},
{_measurement: "foo", _time: 2020-01-01T00:00:41Z, _field: "temp", _value: 4.0, loc: "us"},
])
|> group(columns: ["_measurement", "field", "loc"])
|> last()
|> mqtt.to(
broker: "tcp://localhost:1883",
topic: "test",
username:"rabbitmq",
password:"rabbitmq",
retain: true)
New Info
I tried influxdb on windows and the two method work.
Any ideas what I’m doing wrong here?
Thanks,
Benjamin