update subject to sessionID as ref
This commit is contained in:
parent
a8ef4a2bad
commit
c9aa5b68c0
|
|
@ -40,7 +40,7 @@ function askForMessage() {
|
|||
process.exit(0);
|
||||
}
|
||||
|
||||
nc.publish("test", message);
|
||||
nc.publish("sessionID", message);
|
||||
|
||||
askForMessage();
|
||||
});
|
||||
|
|
|
|||
4
index.ts
4
index.ts
|
|
@ -10,9 +10,9 @@ console.log(
|
|||
const nc = await connect({ servers: NATS_SERVER, token: NATS_AUTH_TOKEN });
|
||||
console.log("Connected to NATS");
|
||||
|
||||
const sub = nc.subscribe("test");
|
||||
const sub = nc.subscribe("sessionID");
|
||||
|
||||
console.log("Subscribed to [test], waiting for messages...\n");
|
||||
console.log("Subscribed to [sessionID], waiting for messages...\n");
|
||||
|
||||
for await (const msg of sub) {
|
||||
console.log(
|
||||
|
|
|
|||
Loading…
Reference in a new issue