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

Method dispatchEvent

packages/microservices/client/client-kafka.ts:363–377  ·  view source on GitHub ↗
(packet: OutgoingEvent)

Source from the content-addressed store, hash-verified

361 }
362
363 protected async dispatchEvent(packet: OutgoingEvent): Promise<any> {
364 const pattern = this.normalizePattern(packet.pattern);
365 const outgoingEvent = await this.serializer.serialize(packet.data, {
366 pattern,
367 });
368 const message = Object.assign(
369 {
370 topic: pattern,
371 messages: [outgoingEvent],
372 },
373 this.options.send || {},
374 );
375
376 return this._producer!.send(message);
377 }
378
379 protected getReplyTopicPartition(topic: string): string {
380 const minimumPartition = this.consumerAssignments[topic];

Callers

nothing calls this directly

Calls 3

assignMethod · 0.80
serializeMethod · 0.65
sendMethod · 0.45

Tested by

no test coverage detected