Skip to content

Commit

Permalink
KAFKA-17544: Add log message for early access use of KafkaShareConsum…
Browse files Browse the repository at this point in the history
…er (apache#17940)

When a KafkaShareConsumer is constructed in AK 4.0, a log message is written warning about the early access nature of the feature.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
  • Loading branch information
AndrewJSchofield authored Nov 26, 2024
1 parent 918a67e commit 5480d54
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.utils.Time;

import org.slf4j.Logger;

/**
* {@code ShareConsumerDelegateCreator} implements a quasi-factory pattern to allow the caller to remain unaware of the
* underlying {@link ShareConsumer} implementation that is created. This provides the means by which
Expand All @@ -41,6 +43,9 @@ public <K, V> ShareConsumerDelegate<K, V> create(final ConsumerConfig config,
final Deserializer<K> keyDeserializer,
final Deserializer<V> valueDeserializer) {
try {
LogContext logContext = new LogContext();
Logger log = logContext.logger(getClass());
log.warn("Share groups and KafkaShareConsumer are part of the early access of KIP-932 and MUST NOT be used in production.");
return new ShareConsumerImpl<>(config, keyDeserializer, valueDeserializer);
} catch (KafkaException e) {
throw e;
Expand All @@ -60,6 +65,8 @@ public <K, V> ShareConsumerDelegate<K, V> create(final LogContext logContext,
final SubscriptionState subscriptions,
final ConsumerMetadata metadata) {
try {
Logger log = logContext.logger(getClass());
log.warn("Share groups and KafkaShareConsumer are part of the early access of KIP-932 and MUST NOT be used in production.");
return new ShareConsumerImpl<>(
logContext,
clientId,
Expand Down

0 comments on commit 5480d54

Please sign in to comment.