spring-cloud / spring-cloud-stream

Framework for building Event-Driven Microservices
http://cloud.spring.io/spring-cloud-stream
Apache License 2.0
1.01k stars 614 forks source link

Kafka producer configuration for all channels is not functioning #2906

Closed akhalifeh79 closed 8 months ago

akhalifeh79 commented 9 months ago

As a referred in the following spring cloud documentation: https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html#kafka-producer-properties

Particularly this phrase

To avoid repetition, Spring Cloud Stream supports setting values for all channels, in the format of spring.cloud.stream.default.=.

I want to configure kafka producer for all channels using the "default" prefix but this is not functioning. I found a solution which is not respecting the official documentation, please see below the configuration the 2 configurations

correct configuration respecting documentation but not functioning

spring.cloud.stream.default.producer.sync=false spring.cloud.stream.default.producer.batchTimeout=60000 spring.cloud.stream.default.producer.compression=gzip

functioning configuration but not respecting documentation

spring.cloud.stream.kafka.default.producer.sync=false spring.cloud.stream.kafka.default.producer.batchTimeout=60000 spring.cloud.stream.kafka.default.producer.compression=gzip

Please confirm that the second configuration is correct and in this case update the official documentation.

I'm using the last version of spring cloud

2023.0.0 Thanks
sobychacko commented 9 months ago

@akhalifeh79 Yes, that is a documentation mix-up. Are you open to fixing it by sending a PR?

sobychacko commented 8 months ago

@akhalifeh79 The docs you linked above are from very old versions. The latest documentation can be found here. We made some adjustments to the snapshot docs to clarify the issues with the default properties on the Kafka bindings.