From 73f4d6e77c565de0bf6cef7a655bc1ab6e9cd756 Mon Sep 17 00:00:00 2001 From: djereg Date: Wed, 24 Apr 2024 14:09:30 +0200 Subject: [PATCH] feat: change rpc message types --- src/rpc/rpc.client.ts | 2 +- src/rpc/rpc.listener.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpc/rpc.client.ts b/src/rpc/rpc.client.ts index 432d858..e429bd7 100644 --- a/src/rpc/rpc.client.ts +++ b/src/rpc/rpc.client.ts @@ -75,7 +75,7 @@ export class RPCClient { exchange: '', expiration: timeout / 2, headers: { - "X-Message-Type": "rpc", + "X-Message-Type": "request", 'Content-Type': 'application/json', }, }; diff --git a/src/rpc/rpc.listener.ts b/src/rpc/rpc.listener.ts index 98e16a8..fc5106e 100644 --- a/src/rpc/rpc.listener.ts +++ b/src/rpc/rpc.listener.ts @@ -26,7 +26,7 @@ export class RPCListener implements OnModuleInit { @MessageHandler() async onMessage({ message, headers, raw }: MessageHandleEvent) { - if (headers['X-Message-Type'] !== 'rpc') { + if (headers['X-Message-Type'] !== 'request') { return; } @@ -44,6 +44,7 @@ export class RPCListener implements OnModuleInit { contentType, headers: { 'Content-Type': 'application/json', + 'X-Message-Type': 'response' } };