nest icon indicating copy to clipboard operation
nest copied to clipboard

feat(microservices): added MqttOption for passing raw output to pub

Open notusertelken opened this issue 3 years ago • 5 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior?

mqtt-server and client stringify the output of the serializer before emitting/publishing events

Issue Number: 7288

What is the new behavior?

moved JSON.stringify to the serializer, so now the output of the serializer goes directly into publish/emit.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

notusertelken avatar Jan 20 '22 01:01 notusertelken

Pull Request Test Coverage Report for Build 6fa77dde-eb4c-4a5b-aab8-98160be3959b

  • 14 of 14 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 94.135%

Totals Coverage Status
Change from base Build 030c7bfc-7fd6-457a-8c24-3f90c6cb9edf: 0.005%
Covered Lines: 5698
Relevant Lines: 6053

💛 - Coveralls

coveralls avatar Jan 20 '22 01:01 coveralls

If this implementation is found acceptable, ill shortly make PRs for the other transport servers

notusertelken avatar Jan 21 '22 12:01 notusertelken

@notusertelken looks good!

kamilmysliwiec avatar Jan 21 '22 12:01 kamilmysliwiec

had forgotten about the client :sweat_smile:

notusertelken avatar Jan 21 '22 22:01 notusertelken

Here is also a string transformation of the payload. Shouldn't it be possible to use raw format too? https://github.com/nestjs/nest/blob/cdf2aa5b067386677fc6b97f934acd7b18da3dcc/packages/microservices/server/server-mqtt.ts#L102

Clex1o1 avatar Apr 26 '22 14:04 Clex1o1