NATS Based Resolver Integration - By NestJS

65 views
Skip to first unread message

Impfromliga

unread,
Aug 1, 2023, 8:42:31 AM8/1/23
to nats
trying to do account NATS resolver by
@EventPattern('$SYS.REQ.ACCOUNT.*.CLAIMS.LOOKUP', Transport.NATS)
in NestJs - it fine capture the Claim lookup messages from Nats server, but how i should to resolve it? I try to resolve by sending
this.client.emit(`\$SYS\.REQ\.ACCOUNT\.${accountId}\.CLAIMS\.UPDATE`,accountJWTstring)
the  accountJWTstring was created by nsc tool
(for now just copy jwt string from resolver_preload section of nsc generate config --nats-resolver --sys-account MyAccount > resolver.conf),
 so it must be fine, but not...
when trying to emit clims update the NATS logs to me
"jwt update resulted in error - n/a - expected 3 chunks"
- but it has exact 3 chunks!!!

may be im dont understend the format for claims update emitting, and this need some else structure above just JWT string. But not found enyware the docs for this special.

What was exact sending (debug: true,
verbose: true
 log) by resolver is:

< PUB $SYS.REQ.ACCOUNT.ABXWZZRHEPIBK3P2D2N2WXVCDRSYN3BWQ5DVQ3F5ILOQVN52FNX367RS.CLAIMS.UPDATE 892␍␊{"pattern":"$SYS.REQ.ACCOUNT
.ABXWZZRHEPIBK3P2D2N2WXVCDRSYN3BWQ5DVQ3F5ILOQVN52FNX367RS.CLAIMS.UPDATE","data":"eyJ0eXHeadHeadHeadHead
.eyJqdPayload
PayloadPayloadPayload.9WoSignatureSignatureSignature"}␍␊

Reply all
Reply to author
Forward
0 new messages