Skip to content

LWT does not reach Pulsar topic, short cuts QoSPublishHandlers so Qos nor Retain function properly #937

Closed

Description

@tsturzl

Describe the bug
LWT does not function as expected. LWTs never reach Pulsar topics, instead the logic seems to be that when an LWT is fired it short cuts straight to finding each MQTT Connection with a subscription on that LWT's topic and then send the LWT directly to that client. This means that LWT's never even reach the QosPublishHandlers, which means an LWT's QoS will not be respected nor will the retain feature work for LWT messages because the QoSPublishHandler is responsible for the retain logic. Most importantly the LWT only reach other MoP connected clients. Currently if you try to send a retained LWT by killing a client and waiting for the connection to timeout, and then you reconnect you will not see the message via MQTT nor Pulsar. If you have a pulsar client connected and get an MQTT conenction to fire an LWT, you will never see it. The only way I can see LWTs is if I connect 2 MQTT clients, and kill one of them while the other has an active subscription on the other topic. Reading through the source code only confirms this behavior.

To Reproduce
Steps to reproduce the behavior:

  1. Start a Pulsar client on a given topic, eg persistent://public/default/test_lwt
  2. Create an MQTT client with an LWT on that topic, additionally set the retain flag
  3. Create a second MQTT client with a subscription on that topic.
  4. Kill the first MQTT client to prevent a graceful disconnect, wait for connection to timeout
  5. The second MQTT client will see the LWT, the Pulsar client will NOT
  6. Connect an additional MQTT client and subscribe on the test topic, you will not see a retained LWT on that topic.

Expected behavior
LWT QoS and retain should function the same as a regular MQTT message. LWTs should reach their destination Pulsar topic.

Activity

  1. changed the title [-]LWT does not reach Pulsar topic, short cuts QoSPublishHandlers[/-] [+]LWT does not reach Pulsar topic, short cuts QoSPublishHandlers so Qos nor Retain function properly[/+] on Apr 20, 2023
  2. tsturzl commented on Apr 20, 2023

    @tsturzl
    ContributorAuthor

    Working towards a PR on this issue currently.

  3. tsturzl commented on Dec 1, 2023

    @tsturzl
    ContributorAuthor

    @mattisonchao @Technoboy- 5 min of your time please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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