Skip to content

Commit 527af83

Browse files
committed
Add Headers to Producers
1 parent 5af371c commit 527af83

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

shared/src/producer/producer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ export abstract class GenericProducer<T extends IEvent> {
1818
}
1919

2020

21-
async send(event: T): Promise<void> {
21+
async send(event: T, headers?: Record<string, string>): Promise<void> {
2222

2323
await this.producer.connect();
2424

2525
await this.producer.send({
2626
topic: this.topic,
27-
messages: [{key: this.key, value: JSON.stringify(event as any)}],
27+
messages: [{key: this.key, value: JSON.stringify(event as any), headers: headers}],
2828
acks: -1 //all
2929
});
3030

0 commit comments

Comments
 (0)