Replies: 2 comments 2 replies
-
What about the performance? Would be good to measure this on the https://github.com/mikro-orm/nestjs-realworld-example-app. Even if it would be slower, we can have that as opt-in, PR welcome for that. |
Beta Was this translation helpful? Give feedback.
-
@B4nan if you're wondering, I setup the I then use Apache Benchmark to run 50 consecutive requests for a total of 5000 requests with the following command:
This is the output for the middleware solution (default untouched codebase, just Default middleware
This is the output for the logic with RequestContext Interceptor
But I have no way of really knowing how well it would run in a microservices architecture where we would use eventsourcing and using long-living |
Beta Was this translation helpful? Give feedback.
-
I'm starting to implement a microservice architecture. But I ran into the issue of RequestContext not being setup for RPCs. That's because NestJS middlewares only work for the HTTP adapter.
I would like to suggest the removal of this middleware, and switch it out with an
Interceptor
variant. The interceptor that I wrote to make it work for my@nestjs/microservices
app is as following:@B4nan what do you think?
Beta Was this translation helpful? Give feedback.
All reactions