Skip to content

Commit

Permalink
Update Producer.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Aug 2, 2024
1 parent fcca1ee commit 5b00d0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utilities/project-factory/src/server/kafka/Producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const sendWithRetries = (payloads: any[], retries = 3, shutdown: boolean = false
producer.send(payloads, async (err: any) => {
if (err) {
logger.error('Error sending message:', err);
logger.debug(`Was trying to send: ${JSON.stringify(payloads)}`);
if (retries > 0) {
logger.info(`Retrying to send message. Retries left: ${retries}`);
await new Promise(resolve => setTimeout(resolve, 2000)); // wait before retrying
Expand Down

0 comments on commit 5b00d0d

Please sign in to comment.