'WIll the kafka producer.client.id & consumer.group.id changes lead to message loss?

I need to change kafka producer.client.id & consumer.group.id on working app.

  1. I do not expect that the change of producer's client.id can affect stability - kafka will just recreate producers on application restart and the will just "reconnect" to the topics.

  2. I doubt that the same behaviour will be in the case of consumer's group.id. As far as I understand, if the message is not acknowledged then any consumer can reconnect to the topic and read it. So this seems to be normal to change consumer's group id.

Could anyone help me to understand, am I right with my 1 and 2 point?



Solution 1:[1]

https://kafka.apache.org/documentation/#producerconfigs_client.id

An id string to pass to the server when making requests. The purpose of this is to be able to track the source of requests beyond just ip/port by allowing a logical application name to be included in server-side request logging.

It's only used in logging.

When changing the group.id on first use, the consumer will be positioned at the beginning or end of the log, depending on auto.offset.reset being earliest or latest.

You would need to perform seeks if you want the new group to start at the current positions of the old group.

https://docs.spring.io/spring-kafka/docs/current/reference/html/#seek

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gary Russell