Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KV/stream republished messages do not propagate to MQTT subscriptions #4291

Closed
1 of 2 tasks
bruth opened this issue Jul 6, 2023 · 0 comments · Fixed by #4303
Closed
1 of 2 tasks

KV/stream republished messages do not propagate to MQTT subscriptions #4291

bruth opened this issue Jul 6, 2023 · 0 comments · Fixed by #4303
Assignees

Comments

@bruth
Copy link
Member

bruth commented Jul 6, 2023

Defect

Make sure that these boxes are checked before submitting your issue -- thank you!

Versions of nats-server and affected client libraries used:

2.9.19, main, and dev

OS/Container environment:

macOS

Steps or code to reproduce the issue:

Start server with MQTT enabled"

server_name: test
jetstream: enabled
mqtt: {
  port: 1883
}

Define a KV bucket with republish configured:

nats kv add config --republish-source='$KV.config.>' --republish-destination='mqtt.config.>'

Start an MQTT client subscription on mqtt/config/# (I used the HiveMQ MQTT CLI), e.g.

mqtt sub -V 3 -t "mqtt/config/#"

Put a key-value pair to the bucket.

nats kv put "device.1" '{"state": "on"}'

Expected result:

The MQTT client receives a message.

Actual result:

It does not.

Note

Starting a NATS sub on mqtt.config.> will result in the message being received, so the republish works, but for some reason, it does not appear to propagate to the MQTT subsystem.

@bruth bruth added the 🐞 bug label Jul 6, 2023
derekcollison added a commit that referenced this issue Jul 13, 2023
…0 subscribers (#4303)

Only discard messages from MQTT QoS0 from internal JetStream clients if
really a QoS1 JetStream publish, not just a JetStream client.

Signed-off-by: Derek Collison <derek@nats.io>

Resolves #4291
@bruth bruth removed the 🐞 bug label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants