diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/DelegatingConsumer.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/DelegatingConsumer.java new file mode 100644 index 0000000..c93aeb5 --- /dev/null +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/DelegatingConsumer.java @@ -0,0 +1,12 @@ +/* + * Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
 See License in the project root for license information. + */ + +package com.linkedin.kafka.clients.consumer; + +import org.apache.kafka.clients.consumer.Consumer; + + +public interface DelegatingConsumer extends Consumer { + Consumer getDelegate(); +} diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/LiKafkaInstrumentedConsumerImpl.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/LiKafkaInstrumentedConsumerImpl.java index e83d38a..5bedd4d 100644 --- a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/LiKafkaInstrumentedConsumerImpl.java +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/consumer/LiKafkaInstrumentedConsumerImpl.java @@ -47,7 +47,7 @@ * @param * @param */ -public class LiKafkaInstrumentedConsumerImpl implements Consumer, EventHandler { +public class LiKafkaInstrumentedConsumerImpl implements DelegatingConsumer, EventHandler { private static final Logger LOG = LoggerFactory.getLogger(LiKafkaInstrumentedConsumerImpl.class); private final long initialConnectionTimeoutMs = TimeUnit.SECONDS.toMillis(30); @@ -154,8 +154,8 @@ public void configChangeRequested(UUID commandId, Map configDiff //TODO - respond to command UUID } - //package-private FOR TESTING - Consumer getDelegate() { + @Override + public Consumer getDelegate() { return delegate; } diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/DelegatingProducer.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/DelegatingProducer.java new file mode 100644 index 0000000..8d838d4 --- /dev/null +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/DelegatingProducer.java @@ -0,0 +1,12 @@ +/* + * Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
 See License in the project root for license information. + */ + +package com.linkedin.kafka.clients.producer; + +import org.apache.kafka.clients.producer.Producer; + + +public interface DelegatingProducer extends Producer { + Producer getDelegate(); +} diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaInstrumentedProducerImpl.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaInstrumentedProducerImpl.java index 2e1d3cb..da8aad0 100644 --- a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaInstrumentedProducerImpl.java +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaInstrumentedProducerImpl.java @@ -49,7 +49,7 @@ * @param * @param */ -public class LiKafkaInstrumentedProducerImpl implements Producer, EventHandler { +public class LiKafkaInstrumentedProducerImpl implements DelegatingProducer, EventHandler { private static final Logger LOG = LoggerFactory.getLogger(LiKafkaInstrumentedProducerImpl.class); private static final String BOUNDED_FLUSH_THREAD_PREFIX = "Bounded-Flush-Thread-"; @@ -156,8 +156,8 @@ public void configChangeRequested(UUID commandId, Map configDiff //TODO - respond to command UUID } - //package-private FOR TESTING - Producer getDelegate() { + @Override + public Producer getDelegate() { return delegate; }