-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
feat(microservices): add specific transport id to microservices #14606
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 specific transport id to microservices #14606
Conversation
Pull Request Test Coverage Report for Build 509e49e5-e054-465a-bd3f-5172427e2355Details
💛 - Coveralls |
926ed5f
to
6c1e30d
Compare
@kamilmysliwiec can u check this PR please? |
return new ServerRedis(options as Required<RedisOptions>['options']); | ||
return new ServerRedis( | ||
options as Required<RedisOptions>['options'], | ||
buildServerSettings, |
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.
instead of introducing a 2nd constructor parameter, wouldn't it be easier to expose a setter for the transportId attribute? And then set it only if the user passed a custom transportId (which won't be the case for 99% apps out there anyway)
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.
That would be easier, but another problem arises - what if the developer changes the transportId via setter at runtime and add handlers dynamically, which will cause unexpected errors because the current Server
code doesn't have a status model like started
or not_started
.
So if you don't want to have a second parameter in the constructor because it will cause breaking changes for those extending the Server
class - we need to make a status model or accept that risk and leave it to the developer's responsibility
I realize it's an unusual problem, but it should have been highlighted.
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.
we can just leave a note on this in the docs
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.
done
6c1e30d
to
5a979f2
Compare
5a979f2
to
076fb0e
Compare
LGTM |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
transportId field is hardcoded in specific server classes.
If users need more concurrency on same server or many servers need to extends from base server classes and override server id
Sample:
Issue Number:
#14590
#11298
What is the new behavior?
Add new property to microservice options interface that overrides default transportId field in specific server classes
Does this PR introduce a breaking change?
Other information