public final class ProducerFactoryUtils
extends java.lang.Object
DefaultKafkaProducerFactory
in particular for obtaining transactional Kafka resources for a given ProducerFactory.
Mainly for internal use within the framework.
Modifier and Type | Method and Description |
---|---|
static void |
clearConsumerGroupId()
Clear the group id for the consumer bound to this thread.
|
static java.lang.String |
getConsumerGroupId()
Get the group id for the consumer bound to this thread.
|
static <K,V> KafkaResourceHolder<K,V> |
getTransactionalResourceHolder(ProducerFactory<K,V> producerFactory)
Obtain a Producer that is synchronized with the current transaction, if any.
|
static <K,V> void |
releaseResources(KafkaResourceHolder<K,V> resourceHolder) |
static void |
setConsumerGroupId(java.lang.String groupId)
Set the group id for the consumer bound to this thread.
|
public static <K,V> KafkaResourceHolder<K,V> getTransactionalResourceHolder(ProducerFactory<K,V> producerFactory)
K
- the key type.V
- the value type.producerFactory
- the ConnectionFactory to obtain a Channel forpublic static <K,V> void releaseResources(KafkaResourceHolder<K,V> resourceHolder)
public static void setConsumerGroupId(java.lang.String groupId)
groupId
- the group id.public static java.lang.String getConsumerGroupId()
public static void clearConsumerGroupId()