diff --git a/src/event/event.emitter.ts b/src/event/event.emitter.ts index 6b40460..09395f5 100644 --- a/src/event/event.emitter.ts +++ b/src/event/event.emitter.ts @@ -18,6 +18,7 @@ export class EventEmitter { headers: { 'X-Message-Type': 'event', 'X-Event-Name': event, + 'Content-Type': 'application/json', }, contentType: 'application/json', priority: 0, diff --git a/src/rpc/rpc.client.ts b/src/rpc/rpc.client.ts index b0d0c00..432d858 100644 --- a/src/rpc/rpc.client.ts +++ b/src/rpc/rpc.client.ts @@ -76,6 +76,7 @@ export class RPCClient { expiration: timeout / 2, headers: { "X-Message-Type": "rpc", + 'Content-Type': 'application/json', }, }; diff --git a/src/rpc/rpc.listener.ts b/src/rpc/rpc.listener.ts index 281a82e..98e16a8 100644 --- a/src/rpc/rpc.listener.ts +++ b/src/rpc/rpc.listener.ts @@ -37,7 +37,15 @@ export class RPCListener implements OnModuleInit { } const { replyTo, deliveryMode, correlationId, contentType } = raw.properties; - const options = { deliveryMode, correlationId, contentType, headers: {} }; + + const options = { + deliveryMode, + correlationId, + contentType, + headers: { + 'Content-Type': 'application/json', + } + }; await this.rmq.publish('', replyTo, response, options); }