Open sleipnir opened 3 years ago
I found the reason. Authentication does not seem to work. When running ActiveMQ without authentication support the process worked accordingly.
docker run -it --rm -e DISABLE_SECURITY=true -p 8161:8161 -p 61616:61616 -p 61613:61613 -p 1883:1883 vromero/activemq-artemis:latest-alpine
[root@sleipnir mercury]# iex -S mix
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Interactive Elixir (1.11.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> config =
...(1)> OffBroadway.MQTT.Config.new(
...(1)> client_id_prefix: "elixir_client_id",
...(1)> server_opts: [
...(1)> host: "localhost",
...(1)> port: "1883",
...(1)> transport: :tcp
...(1)> ]
...(1)> )
%OffBroadway.MQTT.Config{
acknowledger: OffBroadway.MQTT.Acknowledger,
client: OffBroadway.MQTT.Client,
client_id_prefix: "elixir_client_id",
dequeue_interval: 5000,
handler: OffBroadway.MQTT.Handler,
producer: OffBroadway.MQTT.Producer,
queue: OffBroadway.MQTT.Queue,
queue_registry: OffBroadway.MQTT.QueueRegistry,
queue_supervisor: OffBroadway.MQTT.QueueSupervisor,
server: {:tcp, [host: "localhost", port: 1883]},
telemetry_prefix: :off_broadway_mqtt
}
iex(2)> Mercury.Flow.start_link(config, "tags.00666")
{:ok, #PID<0.291.0>}
iex(3)> 2020-10-16 23:35:29.397 [nonode@nohost]:[pid=<0.311.0> file=lib/off_broadway_mqtt/handler.ex ]:[debug]:initializing client
2020-10-16 23:35:29.397 [nonode@nohost]:[pid=<0.311.0> file=lib/off_broadway_mqtt/handler.ex ]:[debug]:client attempting to connect
Hello
ping
After investigating the Tortoise library code, I noticed that:
Hello I am trying to use this library with ActiveMQ Artemis. This broker supports different protocols including [MQTT 3.1.1] (https://activemq.apache.org/components/artemis/documentation/latest/mqtt.html). However when I try to connect I get the error below:
When I use Eclipse Mosquito it works however when I use ActiveMQ Artemis with MQTT enabled it doesn't work.
Below are excerpts of the code used:
Do you have any idea what may be happening?