File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/service-utils/src/node Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ const { CompressionCodecs } = KafkaJS;
1010 * Reference: https://kafka.js.org/docs/producing#producing-messages
1111 */
1212export interface KafkaProducerSendOptions {
13+ // Per-message settings.
1314 acks ?: number ;
1415 timeout ?: number ;
16+
17+ // Per-producer settings.
18+ retries ?: number ;
1519 allowAutoTopicCreation ?: boolean ;
1620 maxInFlightRequests ?: number ;
1721}
@@ -114,6 +118,7 @@ export class KafkaProducer {
114118 this . producer = this . kafka . producer ( {
115119 allowAutoTopicCreation : options ?. allowAutoTopicCreation ?? false ,
116120 maxInFlightRequests : options ?. maxInFlightRequests ?? 1000 ,
121+ retry : { retries : options ?. retries ?? 5 } ,
117122 } ) ;
118123 await this . producer . connect ( ) ;
119124 }
You can’t perform that action at this time.
0 commit comments