| 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]; |