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

[server][vpj][controller] Remove Kafka serialization classes and improve producer flexibility #1538

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sushantmane
Copy link
Collaborator

Remove use of org.apache.kafka.common.serialization classes and update producer for easier parameter addition

Changes:

Kafka Producer Adapter Enhancements

  • Deprecated the old create method and introduced a new default create method in PubSubProducerAdapterFactory.java using PubSubProducerAdapterContext.
  • Modified ApacheKafkaProducerAdapter to use byte[] for keys and values instead of KafkaKey and KafkaMessageEnvelope.
  • Added a new sendMessage method to improve flexibility.
  • Updated ApacheKafkaProducerConfig to include PubSubMessageSerializer and set serializer configurations for Kafka producer.

Configuration Management Improvements

  • Removed unnecessary deserializer configurations from getPubSubConsumerProperties in DumpAdminMessages.java.
  • Updated configuration prefixes in PubSubConstants.java to use PUBSUB_CLIENT_CONFIG_PREFIX.

Code Cleanup

  • Removed SharedKafkaProducerConfig as it is no longer needed.

How was this PR tested?

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

@sushantmane sushantmane force-pushed the li-pubsub-producer-update branch from 07fa3e6 to 01c66e3 Compare February 20, 2025 00:20
Copy link
Contributor

@ZacAttack ZacAttack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok aside from the test failures.

com.linkedin.venice.exceptions.VeniceException: Broker address must be provided to create a pub-sub producer

^^ I think if you just patch that all the failing cases will pass

@FelixGV
Copy link
Contributor

FelixGV commented Feb 24, 2025

Just some high-level comments...

  1. I think for the server/DVC code, it is almost certainly a good idea to use byte[] and let us control the serde on our own. This will open up some new opportunities for optimization.
  2. I think the current API where we can interact with the pub sub via POJOs is probably useful in the rest of the code (e.g. controller certainly, possibly VPJ as well).

So rather than making the old API deprecated, can we just support both? It might make the size of this change smaller as well...

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

Successfully merging this pull request may close these issues.

3 participants