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

NOISSUE - Emit non-SenML messages #279

Merged
merged 3 commits into from
May 14, 2018
Merged

NOISSUE - Emit non-SenML messages #279

merged 3 commits into from
May 14, 2018

Conversation

anovakovic01
Copy link
Contributor

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 on out.unknown.

Add content-type based subjects for non-senml messages to Normalizer.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
@anovakovic01 anovakovic01 requested a review from a team as a code owner May 14, 2018 15:07
@codecov-io
Copy link

codecov-io commented May 14, 2018

Codecov Report

Merging #279 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50e14f0...f16eda3. Read the comment docs.

return err
contentType := strings.ToLower(msg.ContentType)
switch contentType {
case "application/senml+json":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use constant.

subject string = "channel.*"
output string = "normalized"
queue = "normalizers"
subject = "channel.*"
Copy link
Contributor

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.

normalized, err := ef.normalize(msg)
if err != nil {
ef.logger.Warn(fmt.Sprintf("Normalization failed: %s", err))
return err
contentType := strings.ToLower(msg.ContentType)
Copy link
Contributor

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>
@mijicd mijicd merged commit ceb630c into absmach:master May 14, 2018
manuio pushed a commit that referenced this pull request Oct 12, 2020
dborovcanin pushed a commit that referenced this pull request Jan 26, 2024
Signed-off-by: Arvindh <arvindh91@gmail.com>
VeddySama pushed a commit to VeddySama/magistrala that referenced this pull request Apr 3, 2024
Signed-off-by: Arvindh <arvindh91@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit non-SenML messages
3 participants