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

feat(microservices): add new extras param to MessagePattern and EventPattern decorators #8933

Conversation

EugeneKorshenko
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • 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?

The current implementation allows passing only pattern and transport to the microservice transport. No way to attach any handler-specific rich types.

Issue Number: N/A

What is the new behavior?

The new implementation adds optional "extras" parameter for MessagePattern and EventPattern decorators that allows embedding any extra params into each message handler method and improves the experience of creating custom microservice transports.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Add optional "extras" parameter for MessagePattern and
EventPattern decorators. Allow embedding extra params into
each message handler method and improve an experience of
creating custom microservice transports
@coveralls
Copy link

coveralls commented Jan 16, 2022

Pull Request Test Coverage Report for Build f2ee145d-72db-4fdd-936e-4ab6cb4d6b2c

  • 31 of 40 (77.5%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 94.151%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/microservices/listeners-controller.ts 8 17 47.06%
Totals Coverage Status
Change from base Build 6c6442b4-a131-4d7f-a0f8-d2eb1814def7: 0.02%
Covered Lines: 5714
Relevant Lines: 6069

💛 - Coveralls

@EugeneKorshenko
Copy link
Contributor Author

@kamilmysliwiec could you take a quick look at this PR once you have a chance.

@kamilmysliwiec
Copy link
Member

I'll look into this as soon as I can!

@EugeneKorshenko EugeneKorshenko force-pushed the feature/package_microservices/add_extras_to_pattern_decorators branch from 84e545a to a0f148d Compare January 24, 2022 19:42
@underfisk
Copy link

I'm looking forward to see this implemented, currently I'm trying to build a custom transport and adding metadata to the message pattern has been a pain but this simply things @EugeneKorshenko thanks for the PR

@kamilmysliwiec kamilmysliwiec merged commit 0a69e9a into nestjs:master Feb 14, 2022
@kamilmysliwiec
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants