We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9024a8e commit af7079dCopy full SHA for af7079d
apps/basket/src/lib/producer.ts
@@ -16,11 +16,14 @@ let connected = false;
16
await producer.connect();
17
connected = true;
18
19
-export const sendEventSync = async (topic: string, event: any) => {
+export const sendEventSync = async (topic: string, event: any, key?: string) => {
20
try {
21
await producer.send({
22
topic,
23
- messages: [{ value: event }],
+ messages: [{
24
+ value: JSON.stringify(event),
25
+ key: key || event.client_id
26
+ }],
27
timeout: 10000,
28
compression: CompressionTypes.GZIP,
29
});
0 commit comments