@nestjs/microservices
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -94,7 +94,8 @@ "use strict"; | ||
const consumerSubscribeOptions = this.options.subscribe || {}; | ||
const subscribeTo = async (responsePattern) => this.consumer.subscribe({ | ||
topic: responsePattern, | ||
...consumerSubscribeOptions, | ||
}); | ||
await Promise.all(this.responsePatterns.map(subscribeTo)); | ||
if (this.responsePatterns.length > 0) { | ||
await this.consumer.subscribe({ | ||
...consumerSubscribeOptions, | ||
topics: this.responsePatterns, | ||
}); | ||
} | ||
await this.consumer.run(Object.assign(this.options.run || {}, { | ||
@@ -101,0 +102,0 @@ eachMessage: this.createResponseCallback(), |
@@ -210,3 +210,3 @@ /// <reference types="node" /> | ||
run?: Omit<ConsumerRunConfig, 'eachBatch' | 'eachMessage'>; | ||
subscribe?: Omit<ConsumerSubscribeTopics, 'topic'>; | ||
subscribe?: Omit<ConsumerSubscribeTopics, 'topics'>; | ||
producer?: ProducerConfig; | ||
@@ -213,0 +213,0 @@ send?: Omit<ProducerRecord, 'topic' | 'messages'>; |
{ | ||
"name": "@nestjs/microservices", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)", | ||
@@ -25,4 +25,4 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@nestjs/common": "10.0.0", | ||
"@nestjs/core": "10.0.0" | ||
"@nestjs/common": "10.0.1", | ||
"@nestjs/core": "10.0.1" | ||
}, | ||
@@ -29,0 +29,0 @@ "peerDependencies": { |
@@ -73,7 +73,8 @@ "use strict"; | ||
const consumerSubscribeOptions = this.options.subscribe || {}; | ||
const subscribeToPattern = async (pattern) => consumer.subscribe({ | ||
topic: pattern, | ||
...consumerSubscribeOptions, | ||
}); | ||
await Promise.all(registeredPatterns.map(subscribeToPattern)); | ||
if (registeredPatterns.length > 0) { | ||
await this.consumer.subscribe({ | ||
...consumerSubscribeOptions, | ||
topics: registeredPatterns, | ||
}); | ||
} | ||
const consumerRunOptions = Object.assign(this.options.run || {}, { | ||
@@ -80,0 +81,0 @@ eachMessage: this.getMessageHandler(), |
9125
382151