Skip to content

Conversation

@vmtuan12
Copy link
Contributor

@vmtuan12 vmtuan12 commented Jul 3, 2025

Fixes #26129

Description

Add support for max.request.size and batch.size configuration for Kafka producer of Kafka Event Listener

Additional context and related issues

Release notes

Release notes are required, with the following suggested text:

## General
* Add support for `max.request.size` and `batch.size` configuration for Kafka producer of Kafka Event Listener. ({issue}`26129`)

@cla-bot
Copy link

cla-bot bot commented Jul 3, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Tuấn Vũ Minh.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@vmtuan12 vmtuan12 closed this Jul 3, 2025
Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Please document new config properties in event-listeners-kafka.md, and squash commits into one.

Comment on lines +46 to +47
private Long maxRequestSize = 5242880L;
private Long batchSize = 16384L;
Copy link
Member

Choose a reason for hiding this comment

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

Could you leave a code comment explaining how these values are chosen?

Please use long instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for reviewing! This PR has some issues, and I have closed it. I have opened a new PR at #26132. And I'm gonna resolve your comments. Thanks!

return this;
}

public Long getMaxRequestSize()
Copy link
Member

Choose a reason for hiding this comment

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

getters/setters place should be consistent with fields.

return maxRequestSize;
}

@Config("kafka-event-listener.max-request-size")
Copy link
Member

Choose a reason for hiding this comment

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

@ConfigDescription is missing. Same for kafka-event-listener.batch-size

@Config("kafka-event-listener.max-request-size")
public KafkaEventListenerConfig setMaxRequestSize(Long maxRequestSize)
{
Optional.ofNullable(maxRequestSize).ifPresent(value -> this.maxRequestSize = value);
Copy link
Member

Choose a reason for hiding this comment

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

this.maxRequestSize = maxRequestSize;

@Config("kafka-event-listener.batch-size")
public KafkaEventListenerConfig setBatchSize(Long batchSize)
{
Optional.ofNullable(batchSize).ifPresent(value -> this.batchSize = value);
Copy link
Member

Choose a reason for hiding this comment

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

this.batchSize = batchSize;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Kafka Event Listener fails to send logs because max.request.size is fixed at 5242880

2 participants