Doc polishing, remove connectionFactory
(cherry picked from commit 2502a8fe1c)
This commit is contained in:
committed by
Artem Bilan
parent
16f3d8c99d
commit
aa400fa4b8
@@ -133,7 +133,7 @@ public abstract class AbstractKafkaListenerEndpoint<K, V>
|
||||
|
||||
/**
|
||||
* Set the group id to override the {@code group.id} property in the
|
||||
* connectionFactory.
|
||||
* ContainerFactory.
|
||||
* @param groupId the group id.
|
||||
* @since 1.3
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class ProducerFactoryUtils {
|
||||
|
||||
/**
|
||||
* Obtain a Producer that is synchronized with the current transaction, if any.
|
||||
* @param producerFactory the ConnectionFactory to obtain a Channel for
|
||||
* @param producerFactory the ProducerFactory to obtain a Channel for
|
||||
* @param <K> the key type.
|
||||
* @param <V> the value type.
|
||||
* @return the resource holder.
|
||||
@@ -105,12 +105,12 @@ public final class ProducerFactoryUtils {
|
||||
}
|
||||
|
||||
private static <K, V> void bindResourceToTransaction(KafkaResourceHolder<K, V> resourceHolder,
|
||||
ProducerFactory<K, V> connectionFactory) {
|
||||
TransactionSynchronizationManager.bindResource(connectionFactory, resourceHolder);
|
||||
ProducerFactory<K, V> producerFactory) {
|
||||
TransactionSynchronizationManager.bindResource(producerFactory, resourceHolder);
|
||||
resourceHolder.setSynchronizedWithTransaction(true);
|
||||
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||
TransactionSynchronizationManager
|
||||
.registerSynchronization(new KafkaResourceSynchronization<K, V>(resourceHolder, connectionFactory));
|
||||
.registerSynchronization(new KafkaResourceSynchronization<K, V>(resourceHolder, producerFactory));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class KafkaTransactionManager<K, V> extends AbstractPlatformTransactionMa
|
||||
private final ProducerFactory<K, V> producerFactory;
|
||||
|
||||
/**
|
||||
* Create a new KafkaTransactionManager, given a ConnectionFactory.
|
||||
* Create a new KafkaTransactionManager, given a ProducerFactory.
|
||||
* Transaction synchronization is turned off by default, as this manager might be used alongside a datastore-based
|
||||
* Spring transaction manager like DataSourceTransactionManager, which has stronger needs for synchronization. Only
|
||||
* one manager is allowed to drive synchronization at any point of time.
|
||||
|
||||
@@ -1265,12 +1265,12 @@ To configure this feature, set the `idleEventInterval` on the container:
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public KafKaMessageListenerContainer(ConnectionFactory connectionFactory) {
|
||||
public KafkaMessageListenerContainer(ConsumerFactory<String, String> consumerFactory) {
|
||||
ContainerProperties containerProps = new ContainerProperties("topic1", "topic2");
|
||||
...
|
||||
containerProps.setIdleEventInterval(60000L);
|
||||
...
|
||||
KafKaMessageListenerContainer<String, String> container = new KafKaMessageListenerContainer<>(...);
|
||||
KafkaMessageListenerContainer<String, String> container = new KafKaMessageListenerContainer<>(...);
|
||||
return container;
|
||||
}
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user