NPE on instantiation when GroupID missing
See original GitHub issueException appeared in io.confluent.parallelconsumer.ParallelEoSStreamProcessor.checkAutoCommitIsDisabled.
Looks like (ConsumerCoordinator)coordinatorField.get(consumer)
returns a null;
The code of a creation of ParallelStreamProcessor:
@Slf4j
@Component
public class ParallelConsumer {
String inputTopic = "test-topic";
public ParallelConsumer() {
consume();
}
public ParallelStreamProcessor getParallelConsumer(){
org.apache.kafka.clients.consumer.Consumer<String, String> kafkaConsumer = getKafkaConsumer(); // (1)
ParallelConsumerOptions<String, String> options = ParallelConsumerOptions.<String, String>builder()
.ordering(KEY) // (2)
.maxConcurrency(1000) // (3)
.consumer(kafkaConsumer)
.build();
ParallelStreamProcessor<String, String> eosStreamProcessor =
ParallelStreamProcessor.createEosStreamProcessor(options);
eosStreamProcessor.subscribe(of(inputTopic)); // (4)
return eosStreamProcessor;
}
org.apache.kafka.clients.consumer.Consumer<String, String> getKafkaConsumer() {
Properties properties = new Properties();
properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
return new KafkaConsumer<>(properties);
}
public void consume () {
getParallelConsumer().poll(record ->
log.info("Concurrently processing a record: {}", record));
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Fixes #101: NPE on auto commit check by astubbs · Pull Request ...
Successfully merging this pull request may close these issues. NPE on instantiation when GroupID missing. 1 participant. @astubbs.
Read more >Unable to instantiate default tuplizer [org.hibernate.tuple.entity ...
I was simply missing a setter for a property. ... JDK version as 8. the error is gone. ... Hibernate core --> <dependency>...
Read more >Maven Surefire Plugin – Class Loading and Forking
The problem with using an isolated class loader is that your classpath isn't really correct, and some applications can detect this and object....
Read more >Null pointer exception on imported dependency. (Maven ...
So, I just got done coding all day, and I get this wacky error where it seems as though none of my projects...
Read more >Resolving Failed to Configure a DataSource Error - Baeldung
<dependency> <groupId>org.springframework.boot</groupId> ... Since the issue occurs due to the missing database connection, we can solve the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for your reply! @astubbs Could you also provide please proper release version?
Hi @kartius , this is fixed in 302. https://github.com/confluentinc/parallel-consumer/releases/tag/0.3.0.2