|
13 | 13 |
|
14 | 14 | import javax.annotation.Resource;
|
15 | 15 |
|
16 |
| -import org.apache.commons.lang3.StringUtils; |
17 | 16 | import org.apache.kafka.clients.consumer.ConsumerConfig;
|
18 | 17 | import org.apache.kafka.clients.consumer.ConsumerRecord;
|
19 | 18 | import org.apache.kafka.clients.consumer.ConsumerRecords;
|
|
28 | 27 | import org.elasticsearch.kafka.indexer.service.IBatchMessageProcessor;
|
29 | 28 | import org.slf4j.Logger;
|
30 | 29 | import org.slf4j.LoggerFactory;
|
31 |
| -import org.springframework.beans.factory.ObjectFactory; |
32 |
| -import org.springframework.beans.factory.annotation.Autowired; |
33 | 30 | import org.springframework.beans.factory.annotation.Value;
|
34 | 31 |
|
35 | 32 | public class ConsumerWorker implements AutoCloseable, IConsumerWorker {
|
@@ -70,7 +67,6 @@ public void initConsumerInstance(int consumerInstanceId) {
|
70 | 67 | kafkaProperties.put(ConsumerConfig.CLIENT_ID_CONFIG, consumerClientId);
|
71 | 68 | kafkaProperties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
|
72 | 69 | consumer = new KafkaConsumer<>(kafkaProperties);
|
73 |
| - registerConsumerForJMX(); |
74 | 70 | logger.info(
|
75 | 71 | "Created ConsumerWorker with properties: consumerClientId={}, consumerInstanceName={}, kafkaTopic={}, kafkaProperties={}",
|
76 | 72 | consumerClientId, consumerInstanceName, kafkaTopic, kafkaProperties);
|
@@ -162,10 +158,6 @@ public void exposeOffsetPosition(Map<TopicPartition, OffsetAndMetadata> previous
|
162 | 158 | // NO OP
|
163 | 159 | }
|
164 | 160 |
|
165 |
| - public void registerConsumerForJMX() { |
166 |
| - // NO OP |
167 |
| - } |
168 |
| - |
169 | 161 | private void commitOffsetsIfNeeded(boolean shouldCommitThisPoll, Map<TopicPartition, OffsetAndMetadata> partitionOffsetMap) {
|
170 | 162 | try {
|
171 | 163 | if (shouldCommitThisPoll) {
|
|
0 commit comments