Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Kafka Client #58

Open
cer opened this issue Aug 7, 2022 · 4 comments
Open

Upgrade Kafka Client #58

cer opened this issue Aug 7, 2022 · 4 comments

Comments

@cer
Copy link
Contributor

cer commented Aug 7, 2022

The 2.3.0 client is very old. It should be replaced with 3.x

compile 'org.apache.kafka:kafka-clients:2.3.0'

We should consider upgrading the broker too:

ENV KAFKA_VERSION=kafka_2.13-2.8.1

@ddaeyongee
Copy link

ddaeyongee commented Aug 12, 2022

@cer
Hi. This is Taeyong from LG organization.

Currently, In our project, we do not use the apache kafka client license directly, but purchase a paid license for the confluent platform and use it.
The confluent platform version used is 6.1, and the confluent(kafka) version 6.1.1 is compatible with apache kafka 2.7.x.
According to the "Confluent Platform 3.2 and later" section of confluent's guide,

 "Kafka Java Clients that are included in Confluent Platform 3.2 (Kafka version 0.10.2) and later are compatible with any Kafka broker that is included in Confluent Platform 3.0 and later. " 

link : https://docs.confluent.io/platform/current/installation/versions-interoperability.html#ak-java-clients

So, compatibility between kafka client 3.x and confluent(kafka) 6.1.1 seems to be fine.
Thank you for your active support.

confluent_compatible_version

@cer
Copy link
Contributor Author

cer commented Aug 24, 2022

Also, need to review/optimize:

  • Consumer properties -

    Properties consumerProperties = new Properties();
    consumerProperties.put("bootstrap.servers", bootstrapServers);
    consumerProperties.put("group.id", subscriberId);
    consumerProperties.put("enable.auto.commit", "false");
    //consumerProperties.put("auto.commit.interval.ms", "1000");
    consumerProperties.put("session.timeout.ms", "30000");
    consumerProperties.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
    consumerProperties.put("value.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer");
    consumerProperties.put("auto.offset.reset", "earliest");
    return consumerProperties;

  • Producer properties -

    producerProps = new Properties();
    producerProps.put("bootstrap.servers", bootstrapServers);
    producerProps.put("acks", "all");
    producerProps.put("retries", 0);
    producerProps.put("batch.size", 16384);
    producerProps.put("linger.ms", 1);
    producerProps.put("buffer.memory", 33554432);
    producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
    producerProps.put("value.serializer", "org.apache.kafka.common.serialization.ByteArraySerializer");
    producerProps.putAll(eventuateKafkaProducerConfigurationProperties.getProperties());

For example, enable idempotent producer + ack=all + etc.

cer added a commit to eventuate-foundation/eventuate-cdc that referenced this issue Sep 1, 2022
@cer
Copy link
Contributor Author

cer commented Sep 13, 2022

Notes on version compatibility:

@cer
Copy link
Contributor Author

cer commented Sep 13, 2022

Kafka Client 3.1.1 seems like a reasonable choice - used by Spring Boot dependencies.

cer added a commit that referenced this issue Sep 13, 2022
cer added a commit that referenced this issue Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants