(options?: {
groupId?: string;
})
| 214 | const consumers = new Set<Consumer>(); |
| 215 | |
| 216 | export const createKafkaEventsConsumer = (options?: { |
| 217 | groupId?: string; |
| 218 | }): Consumer => { |
| 219 | const client = getKafka(); |
| 220 | const consumer = client.consumer({ |
| 221 | groupId: options?.groupId || KAFKA_CONSUMER_GROUP, |
| 222 | sessionTimeout: KAFKA_SESSION_TIMEOUT_MS, |
| 223 | heartbeatInterval: KAFKA_HEARTBEAT_INTERVAL_MS, |
| 224 | minBytes: KAFKA_MIN_BYTES, |
| 225 | maxWaitTimeInMs: KAFKA_MAX_WAIT_MS, |
| 226 | maxBytesPerPartition: KAFKA_MAX_BYTES_PER_PARTITION, |
| 227 | }); |
| 228 | consumers.add(consumer); |
| 229 | return consumer; |
| 230 | }; |
| 231 | |
| 232 | export const disconnectKafka = async (): Promise<void> => { |
| 233 | const tasks: Promise<unknown>[] = []; |
no test coverage detected