K
- the key type.V
- the value type.public interface ConsumerFactory<K,V>
Consumer
instance(s).Modifier and Type | Method and Description |
---|---|
default org.apache.kafka.clients.consumer.Consumer<K,V> |
createConsumer()
Create a consumer with the group id and client id as configured in the properties.
|
default org.apache.kafka.clients.consumer.Consumer<K,V> |
createConsumer(java.lang.String clientIdSuffix)
Create a consumer, appending the suffix to the
client.id property,
if present. |
default org.apache.kafka.clients.consumer.Consumer<K,V> |
createConsumer(java.lang.String groupId,
java.lang.String clientIdSuffix)
Create a consumer with an explicit group id; in addition, the
client id suffix is appended to the
client.id property, if both
are present. |
org.apache.kafka.clients.consumer.Consumer<K,V> |
createConsumer(java.lang.String groupId,
java.lang.String clientIdPrefix,
java.lang.String clientIdSuffix)
Create a consumer with an explicit group id; in addition, the
client id suffix is appended to the clientIdPrefix which overrides the
client.id property, if present. |
default org.apache.kafka.clients.consumer.Consumer<K,V> |
createConsumer(java.lang.String groupId,
java.lang.String clientIdPrefix,
java.lang.String clientIdSuffix,
java.util.Properties properties)
Create a consumer with an explicit group id; in addition, the
client id suffix is appended to the clientIdPrefix which overrides the
client.id property, if present. |
default java.util.Map<java.lang.String,java.lang.Object> |
getConfigurationProperties()
Return an unmodifiable reference to the configuration map for this factory.
|
default org.apache.kafka.common.serialization.Deserializer<K> |
getKeyDeserializer()
Return the configured key deserializer (if provided as an object instead
of a class name in the properties).
|
default org.apache.kafka.common.serialization.Deserializer<V> |
getValueDeserializer()
Return the configured value deserializer (if provided as an object instead
of a class name in the properties).
|
boolean |
isAutoCommit()
Return true if consumers created by this factory use auto commit.
|
default org.apache.kafka.clients.consumer.Consumer<K,V> createConsumer()
default org.apache.kafka.clients.consumer.Consumer<K,V> createConsumer(@Nullable java.lang.String clientIdSuffix)
client.id
property,
if present.clientIdSuffix
- the suffix.default org.apache.kafka.clients.consumer.Consumer<K,V> createConsumer(@Nullable java.lang.String groupId, @Nullable java.lang.String clientIdSuffix)
client.id
property, if both
are present.groupId
- the group id.clientIdSuffix
- the suffix.org.apache.kafka.clients.consumer.Consumer<K,V> createConsumer(@Nullable java.lang.String groupId, @Nullable java.lang.String clientIdPrefix, @Nullable java.lang.String clientIdSuffix)
client.id
property, if present.groupId
- the group id.clientIdPrefix
- the prefix.clientIdSuffix
- the suffix.default org.apache.kafka.clients.consumer.Consumer<K,V> createConsumer(@Nullable java.lang.String groupId, @Nullable java.lang.String clientIdPrefix, @Nullable java.lang.String clientIdSuffix, @Nullable java.util.Properties properties)
client.id
property, if present. In addition, consumer properties can
be overridden if the factory implementation supports it.groupId
- the group id.clientIdPrefix
- the prefix.clientIdSuffix
- the suffix.properties
- the properties to override.boolean isAutoCommit()
default java.util.Map<java.lang.String,java.lang.Object> getConfigurationProperties()
@Nullable default org.apache.kafka.common.serialization.Deserializer<K> getKeyDeserializer()
@Nullable default org.apache.kafka.common.serialization.Deserializer<V> getValueDeserializer()