GH-1145: Remove destroying producer factory
Remove the un-ncessary call to destroy the producer when checking for partitions. This way, the producer is cached and reused at the first time data is produced. Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1145
This commit is contained in:
committed by
Gary Russell
parent
2b7f6ecb96
commit
d57091d791
@@ -399,9 +399,6 @@ public class KafkaMessageChannelBinder extends
|
||||
List<PartitionInfo> partitionsFor = producer
|
||||
.partitionsFor(destination.getName());
|
||||
producer.close();
|
||||
if (transMan == null) {
|
||||
((DisposableBean) producerFB).destroy();
|
||||
}
|
||||
return partitionsFor;
|
||||
}, destination.getName());
|
||||
this.topicsInUse.put(destination.getName(),
|
||||
|
||||
Reference in New Issue
Block a user