nest
nest copied to clipboard
feat(microservices): added MqttOption for passing raw output to pub
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
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 | |
|---|---|
| Change from base Build 030c7bfc-7fd6-457a-8c24-3f90c6cb9edf: | 0.005% |
| Covered Lines: | 5698 |
| Relevant Lines: | 6053 |
💛 - Coveralls
If this implementation is found acceptable, ill shortly make PRs for the other transport servers
@notusertelken looks good!
had forgotten about the client :sweat_smile:
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