-
Notifications
You must be signed in to change notification settings - Fork 41
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
Which message pattern does the Pub/Sub library expose for effective routing #264
Comments
Looks like GCPPubSubServer Class needs to expose a transportId similar to https://github.com/nestjs/nest/blob/master/packages/microservices/server/server-redis.ts#L24 |
Hey @kylehouston, that is a good question! And yes you are right, we should add the It might be interesting to ask the question to the Nest Discord channel in order to know how we could handle hybrid applications with a custom microservice. |
Thanks @ccoeurderoy - yeah the I'll reach out in the Discord for sure and see where things go! |
I could disable the TS check with a dirty /**
* Transport ID required to bind transport when using hybrid applications
* ⚠️ Custom number but could have conflict if Nest creates a new transport with this number
*/
// @ts-ignore
public readonly transportId: number = 10000; But I don't like that honestly 😅 It also requires the |
I'll keep this issue open until Nest provides a clean answer |
Thanks @ccoeurderoy, looking again at the MessagePattern, there's a param for metadata - is there anything in the pub/sub library options I could use?
Logged a message in the support channel, hopefully someone will come back with a nice way to make this work :) |
Well, honestly I don't know since this signature has never been mentioned in the Nest documentation (sorry for the late answer) By the way, did you get an answer from Discord? |
No worries @ccoeurderoy - no reply in discord :/ I'll try following up, doesn't make sense that a custom strategy transport id should be a list of known nestjs enums |
Hey @kylehouston, I may be wrong, but it seems to be available since v8.3.0 (see this pull request) 🥳 |
When using the NestJS hybrid approach what transport do we add to the
@MessagePattern
to ensure the events get routed to the correct callback?export declare const MessagePattern: <T = string | PatternMetadata>(metadata?: T, transport?: Transport) => MethodDecorator;
The text was updated successfully, but these errors were encountered: