Is there an existing issue for this?
Current behavior
I want to send back from my method decorated with MessagePattern/EventPattern data with NATS headers and turns out that they're not passed in any way.
I tried with setting
@MessagePattern('abc')
method(@Ctx() context: NatsContext) {
ctx.getHeaders().set('response-header', 'abc')
return 'my data';
}
with hope that they will be applied but with no luck - they're undefined 😂
Minimum reproduction code
https://github.com/Dzixxx/nestjs-typescript-starter-we4m7w
Steps to reproduce
No response
Expected behavior
I would expect that @Ctx() context: NatsContext will have method setResponseHeader and in ServerNats.getPublisher method it will apply them to packet and default serializer will handle it:
// line 26 of nats-record.serializer.ts
: new NatsRecordBuilder(packet?.data).build()
// new line 26 of nats-record.serializer.ts
: new NatsRecordBuilder(packet?.data).setHeaders(packet?.headers).build()
I'm open for any solution and even preparing PR (but I will need some help with preparing the solution)
Dziczek 😉
Package
Other package
No response
NestJS version
9
Packages versions
Node.js version
16
In which operating systems have you tested?
Other
No response
Is there an existing issue for this?
Current behavior
I want to send back from my method decorated with MessagePattern/EventPattern data with NATS headers and turns out that they're not passed in any way.
I tried with setting
with hope that they will be applied but with no luck - they're
undefined😂Minimum reproduction code
https://github.com/Dzixxx/nestjs-typescript-starter-we4m7w
Steps to reproduce
No response
Expected behavior
I would expect that
@Ctx() context: NatsContextwill have methodsetResponseHeaderand inServerNats.getPublishermethod it will apply them to packet and default serializer will handle it:I'm open for any solution and even preparing PR (but I will need some help with preparing the solution)
Dziczek 😉
Package
@nestjs/common@nestjs/core@nestjs/microservices@nestjs/platform-express@nestjs/platform-fastify@nestjs/platform-socket.io@nestjs/platform-ws@nestjs/testing@nestjs/websocketsOther package
No response
NestJS version
9
Packages versions
Node.js version
16
In which operating systems have you tested?
Other
No response