parallel-consumer icon indicating copy to clipboard operation
parallel-consumer copied to clipboard

Apache-client 3.9.1 (used in spring 3.5.0) not compatible with 0.5.3.2 of parallelConsumer

Open olivier-lam opened this issue 7 months ago • 7 comments

Hi,

Its seems to me that the compatibility with a new version of Apache-client 3.9.1 with the current implementation of parallel consumer does not work anymore. It seems that this newer version remove the "org.apache.kafka.clients.consumer.internals.LegacyKafkaConsumer" and replace it with "org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer", this leads to an issue on getAutoCommitEnabled method where we always enter inside the else part

if ("org.apache.kafka.clients.consumer.internals.LegacyKafkaConsumer".equals(delegate.getClass().getName())) { final boolean autoCommitEnabled = getAutoCommitEnabledFromCoordinator(delegate.getClass(), delegate); return Optional.of(autoCommitEnabled); } else if ("org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer".equals(delegate.getClass().getName())) { final Field autoCommitEnabledField = delegate.getClass().getDeclaredField("autoCommitEnabled"); //NoSuchFieldException autoCommitEnabledField.setAccessible(true); final boolean autoCommitEnabled = (boolean) autoCommitEnabledField.get(delegate); //IllegalAccessException return Optional.of(autoCommitEnabled); } else { log.warn("Encountered unknown consumer delegate {}", consumer.getClass()); return Optional.empty(); }

Thanks a lot for you help.

Kind regards olivier

olivier-lam avatar Jun 03 '25 09:06 olivier-lam

This seems to be the commit, where the class was renamed. Any chance of getting this fixed soon? This affects projects upgrading from spring-boot 3.4.x to 3.5.0, which includes kafka 3.9.1 by default.

SebastianGoeb avatar Jun 13 '25 08:06 SebastianGoeb

+1 for this, we have the same problem

ajax-semenov-y avatar Jul 31 '25 14:07 ajax-semenov-y

also have this problem :'(

SpikeBoot avatar Jul 31 '25 16:07 SpikeBoot

+1

sigevsky avatar Aug 01 '25 09:08 sigevsky

This is fixed in master

smjn avatar Aug 06 '25 12:08 smjn

Is a release planned in the near future?

yevheniisemenov avatar Aug 21 '25 13:08 yevheniisemenov

The last release took nearly a year, support for Kafka 3.9.1 has been merged in November: https://github.com/confluentinc/parallel-consumer/pull/841 Could you retry with 0.5.3.3?

Please be aware that Spring Boot 4 will depend on Kafka 4.1 (release is planned for 2025-11-20): https://github.com/spring-projects/spring-boot/blob/v4.0.0-M3/platform/spring-boot-dependencies/build.gradle#L1134

reneleonhardt avatar Sep 21 '25 07:09 reneleonhardt