MCPcopy
hub / github.com/nestjs/nest / bindTopics

Method bindTopics

packages/microservices/client/client-kafka.ts:196–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 }
195
196 public async bindTopics(): Promise<void> {
197 if (!this._consumer) {
198 throw Error('No consumer initialized');
199 }
200
201 const consumerSubscribeOptions = this.options.subscribe || {};
202
203 if (this.responsePatterns.length > 0) {
204 await this._consumer.subscribe({
205 ...consumerSubscribeOptions,
206 topics: this.responsePatterns,
207 });
208 }
209
210 await this._consumer.run(
211 Object.assign(this.options.run || {}, {
212 eachMessage: this.createResponseCallback(),
213 }),
214 );
215 }
216
217 public createClient<T = any>(): T {
218 const kafkaConfig: KafkaConfig = Object.assign(

Callers 2

connectMethod · 0.95

Calls 4

subscribeMethod · 0.80
runMethod · 0.80
assignMethod · 0.80

Tested by

no test coverage detected