Transactional binder producer factory

With a transactional binder, the producer factory should not be destroyed.

Resolves #626
This commit is contained in:
Soby Chacko
2019-04-08 14:18:43 -04:00
committed by Gary Russell
parent 90c1b37354
commit 40b53ee58b

View File

@@ -214,7 +214,9 @@ public class KafkaMessageChannelBinder extends
Producer<byte[], byte[]> producer = producerFB.createProducer();
List<PartitionInfo> partitionsFor = producer.partitionsFor(destination.getName());
producer.close();
((DisposableBean) producerFB).destroy();
if (this.transactionManager == null) {
((DisposableBean) producerFB).destroy();
}
return partitionsFor;
});
this.topicsInUse.put(destination.getName(), new TopicInformation(null, partitions));