Skip to content

Commit

Permalink
Merge pull request #6 from djereg/dev
Browse files Browse the repository at this point in the history
feat: change rpc message types
  • Loading branch information
djereg authored Apr 24, 2024
2 parents 85e78d7 + 73f4d6e commit 1758505
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rpc/rpc.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class RPCClient {
exchange: '',
expiration: timeout / 2,
headers: {
"X-Message-Type": "rpc",
"X-Message-Type": "request",
'Content-Type': 'application/json',
},
};
Expand Down
3 changes: 2 additions & 1 deletion src/rpc/rpc.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -44,6 +44,7 @@ export class RPCListener implements OnModuleInit {
contentType,
headers: {
'Content-Type': 'application/json',
'X-Message-Type': 'response'
}
};

Expand Down

0 comments on commit 1758505

Please sign in to comment.