From c17851d767ace7a74cf73a4d2527805d32787394 Mon Sep 17 00:00:00 2001 From: Alex Layton Date: Fri, 23 Jul 2021 16:31:53 -0400 Subject: [PATCH] Wait for producer to be ready before send --- oada/libs/oada-lib-kafka/src/base.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oada/libs/oada-lib-kafka/src/base.ts b/oada/libs/oada-lib-kafka/src/base.ts index a2008163..28448c46 100755 --- a/oada/libs/oada-lib-kafka/src/base.ts +++ b/oada/libs/oada-lib-kafka/src/base.ts @@ -213,6 +213,9 @@ export class Base extends EventEmitter { topic?: string; part: number | null; }) { + // Wait for producer to be ready? + await this.ready + // Assume all messages are JSON const value = JSON.stringify({ time: Date.now(),