@nestjs-plugins/nestjs-nats-streaming-transport
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -35,7 +35,8 @@ "use strict"; | ||
const subscription = this.connection.subscribe(subject, this.queueGroup, options); | ||
subscription.on('message', (msg) => { | ||
subscription.on('message', async (msg) => { | ||
const handler = this.getHandlerByPattern(subject); | ||
const data = parse_message_1.parseMessage(msg); | ||
const context = new nats_streaming_context_1.NatsStreamingContext([msg]); | ||
handler(data, context); | ||
const stream = this.transformToObservable(await handler(data, context)); | ||
this.send(stream, () => null); | ||
}); | ||
@@ -42,0 +43,0 @@ this.logger.log(`Subscribed to ${subject}`); |
{ | ||
"name": "@nestjs-plugins/nestjs-nats-streaming-transport", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Nats Streaming Transport for NestJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -109,8 +109,10 @@ # Nats Streaming Transport Module for NestJS | ||
imports: [ | ||
NatsStreamingTransport.forRoot( | ||
'my-cluster'/* clusterID */, | ||
'user-service-publisher'/* clientID */, | ||
NatsStreamingTransport.register( | ||
{ | ||
url: 'http://127.0.0.1:4222', | ||
} /* TransportConnectOptions */ | ||
clientId: 'user-service-publisher', | ||
clusterId: 'my-cluster', | ||
connectOptions: { | ||
url: 'http://127.0.0.1:4222', | ||
}, | ||
} | ||
), | ||
@@ -117,0 +119,0 @@ ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
536569
35
324
214
3
70