-
Notifications
You must be signed in to change notification settings - Fork 677
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 - Emit non-SenML messages #279
Conversation
Add content-type based subjects for non-senml messages to Normalizer. Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
Codecov Report
@@ Coverage Diff @@
## master #279 +/- ##
=======================================
Coverage 90.36% 90.36%
=======================================
Files 10 10
Lines 166 166
=======================================
Hits 150 150
Misses 13 13
Partials 3 3 Continue to review full report at Codecov.
|
normalizer/normalizer.go
Outdated
return err | ||
contentType := strings.ToLower(msg.ContentType) | ||
switch contentType { | ||
case "application/senml+json": |
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.
Please use constant.
normalizer/normalizer.go
Outdated
subject string = "channel.*" | ||
output string = "normalized" | ||
queue = "normalizers" | ||
subject = "channel.*" |
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.
Let's rename to input
.
normalizer/normalizer.go
Outdated
normalized, err := ef.normalize(msg) | ||
if err != nil { | ||
ef.logger.Warn(fmt.Sprintf("Normalization failed: %s", err)) | ||
return err | ||
contentType := strings.ToLower(msg.ContentType) |
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.
Please replace with:
switch ct := strings.ToLower(msg.ContentType); ct {
...
}
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
This pull request resolves #239.
Add
out.[content-type]
subjects for non-senml messages to NATS. If content type is unknown, message will be published onout.unknown
.