Closed garyrussell closed 3 years ago
It is not clear why the producer factory is destroyed after creating a producer to check the partitions.
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/pull/626
This changed it to only destroy when transactions are not enabled because it caused undesirable side effects because the factory is shared.
However, there is no reason that the producer cached by this operation can't remain in the cache for use by producer bindings.
The only reason I can think of is that if the application never produces any data, the producer will sit there unused, but that seems unusual.
https://gitter.im/spring-cloud/spring-cloud-stream?at=614212518065e87a8ee50dc9
It is not clear why the producer factory is destroyed after creating a producer to check the partitions.
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/pull/626
This changed it to only destroy when transactions are not enabled because it caused undesirable side effects because the factory is shared.
However, there is no reason that the producer cached by this operation can't remain in the cache for use by producer bindings.
The only reason I can think of is that if the application never produces any data, the producer will sit there unused, but that seems unusual.