Skip to content

MQTT broker zombie subscriptions? #2362

Description

@owain-rutherford

Description

Hello, we have been using FROST-Server in our project for a year now and it works well, thanks!
I have a daemon process that manages & persists alert rules from users to alert on values in the frost observations data. The daemon process subscribes to the frost mqtt broker using topics of the form "Datastreams(xyz)/Observations"

Problem

If my daemon application exits cleanly, I get these messages in the frost logs, which are expected:

10:35:58.094 TRACE  d.f.i.i.f.m.moquette.MoquetteMqttServer -       Client disconnected: b93e8989-8024-41b4-84e7-706c93f72c14
10:35:58.097 DEBUG d.f.i.i.frostserver.mqtt.SubscriptionSet - Now 0 subscriptions for topic v1.1/Datastreams(2775)/Observations?$filter=2.0 mul result add 5.0 gt 10.0.
10:35:58.097 DEBUG d.f.i.i.frostserver.mqtt.SubscriptionSet - Removed last subscription for topic v1.1/Datastreams(2775)/Observations?$filter=2.0 mul result add 5.0 gt 10.0.

However, if my application is shutdown with a SIGKILL for example, I do not receive the disconnected log message (after waiting for mqtt.persistent.client.expiration seconds), and when the application starts again it reads from a database of active alert rules to resubscribe (using the same client identifier) to the previous list of topics:

10:39:53.115 TRACE  d.f.i.i.f.m.moquette.MoquetteMqttServer -       Client connected: b93e8989-8024-41b4-84e7-706c93f72c14
10:39:53.164 TRACE  d.f.i.i.f.m.moquette.MoquetteMqttServer -       Client b93e8989-8024-41b4-84e7-706c93f72c14 subscribed to v1.1/Datastreams(2775)/Observations?$filter=2.0 mul result add 5.0 gt 10.0
10:39:53.166 DEBUG d.f.i.i.frostserver.mqtt.SubscriptionSet - Now 2 subscriptions for topic v1.1/Datastreams(2775)/Observations?$filter=2.0 mul result add 5.0 gt 10.0.

Can you advise if there is an issue here with zombie subscriptions, or have I misconfigured / misunderstood something? I am using version 2.7.2 with separated http & mqtt components using mosquito. I have tried changing the clean session flag in the client configuration but the behaviour is the same.

Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions