smartrent / jackalope

An opinionated MQTT client library based on Tortoise MQTT
Apache License 2.0
28 stars 5 forks source link

Subcriptions not working #93

Closed corck closed 1 year ago

corck commented 1 year ago

Thanks for creating Jackalope. We try to use it to connect to AWS IOT. We got it running, but it seems the subscriptions we pass in are not properly passed to Tortoise311

our configuration

  Supervisor.child_spec(
        {
          Jackalope,
          subscriptions: [{"cm/v1/device/+/data", 0}]
          client_id: "cm-mqtt",
          handler: Processor.Handler,
          server: server_opts
        },
        id: Tortoise311.Connection.Parametric,
        restart: :permanent
      )

only after manually subscribing we receive data

Tortoise311.Connection.subscribe_sync("cm-mqtt", [{"cm/v1/device/+/data", 0}])

corck commented 1 year ago

Just realized going through the code that subscriptions is not supported and that initial_topics needs to be used, which doesn't allow to set QOS level, so a binary array needs to be passed instead of a tuple array like in tortoise.