-
Notifications
You must be signed in to change notification settings - Fork 673
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
NOISSUE - Set subtopic for messages published outside adapters #1867
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1867 +/- ##
=======================================
Coverage 64.73% 64.74%
=======================================
Files 118 118
Lines 9702 9704 +2
=======================================
+ Hits 6281 6283 +2
Misses 2753 2753
Partials 668 668
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
I think it is safe to close this one, as |
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
pkg/messaging/nats/pubsub.go
Outdated
@@ -162,6 +162,9 @@ func (ps *pubsub) natsHandler(h messaging.MessageHandler) broker.MsgHandler { | |||
ps.logger.Warn(fmt.Sprintf("Failed to unmarshal received message: %s", err)) | |||
return | |||
} | |||
if msg.Subtopic == "" { | |||
msg.Subtopic = m.Subject // set for messages not published using adapters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? This is confusing.
If there is no subtopic, it should stay an empty string.
Signed-off-by: SammyOina <sammyoina@gmail.com>
I am going to update the example in the docs instead which should have the same result |
Signed-off-by: SammyOina sammyoina@gmail.com
What does this do?
Sets message subtopic to subject/routing key when not set as in the case for messages published using external clients as in heartbeat service of mainflux/agent#56.
To test on nats:
Using rabbitmq:
Which issue(s) does this PR fix/relate to?
None
List any changes that modify/break current functionality
Have you included tests for your changes?
No
Did you document any new/modified functionality?
Notes