Skip to content

Commit

Permalink
feat: Add option to configure kafka producer maxRequestSize
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisingenhaag committed Mar 6, 2024
1 parent b86cf57 commit 79900b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class KafkaProperties {
@Value("${acks:1}")
private String acks;

@Value("${maxRequestSize:1048576}")
private String maxRequestSize;

private Compression compression = new Compression();

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private ProducerFactory<String, String> producerFactory(KafkaProperties kafkaPro
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.ACKS_CONFIG, kafkaProperties.getAcks());
props.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, kafkaProperties.getMaxRequestSize());

final var compression = kafkaProperties.getCompression();
log.info("Compression is {}", compression.isEnabled() ? "enabled" : "disabled");
Expand Down

0 comments on commit 79900b2

Please sign in to comment.