KafkaJS Consumer Group IDs Showing as UUIDs in AWS MSK CloudWatch Metrics

47 Views Asked by At

I'm using KafkaJS with an Amazon Managed Streaming for Kafka (MSK) cluster and encountering an issue where my consumer group IDs are appearing as UUIDs in the AWS CloudWatch metrics, instead of the specific group IDs I've set in my code. I'm looking for insights or suggestions on what might be causing this and how to resolve it.

Code Snippet:

const { Kafka } = require('kafkajs');

const kafka = new Kafka({
    clientId: 'msk-client-example-consumer',
    brokers: [/* list of brokers */],
    sasl: createMechanism({ region: 'my-region' }),
    ssl: true,
});

this.consumer = kafka.consumer({ groupId: 'msk-client-example-consumer' });

// Consumer initialization and message processing logic here

I expected the consumer group to be 'msk-client-example-consumer', but in the CloudWatch metrics, it's showing up as a UUID like '312ced58-6b14-46c6-94dd-adc103d0c8de'.

Trouble Shooting Steps Taken

I attempted replicating this in a local cluster and the groupids work fine there.

0

There are 0 best solutions below