Class DelegatingByTopicSerializer
java.lang.Object
org.springframework.kafka.support.serializer.DelegatingByTopicSerialization<org.apache.kafka.common.serialization.Serializer<?>>
org.springframework.kafka.support.serializer.DelegatingByTopicSerializer
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.kafka.common.serialization.Serializer<Object>
public class DelegatingByTopicSerializer
extends DelegatingByTopicSerialization<org.apache.kafka.common.serialization.Serializer<?>>
implements org.apache.kafka.common.serialization.Serializer<Object>
A 
Serializer that delegates to other serializers based on a topic pattern.- Since:
- 2.8
- Author:
- Gary Russell
- 
Field SummaryFields inherited from class org.springframework.kafka.support.serializer.DelegatingByTopicSerializationCASE_SENSITIVE, KEY_SERIALIZATION_TOPIC_CONFIG, KEY_SERIALIZATION_TOPIC_DEFAULT, VALUE_SERIALIZATION_TOPIC_CONFIG, VALUE_SERIALIZATION_TOPIC_DEFAULT
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct an instance that will be configured inconfigure(Map, boolean)with producer propertiesDelegatingByTopicSerialization.VALUE_SERIALIZATION_TOPIC_CONFIGandDelegatingByTopicSerialization.KEY_SERIALIZATION_TOPIC_CONFIG.DelegatingByTopicSerializer(Map<Pattern, org.apache.kafka.common.serialization.Serializer<?>> delegates, org.apache.kafka.common.serialization.Serializer<?> defaultDelegate) Construct an instance with the supplied mapping of topic patterns to delegate serializers.
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected org.apache.kafka.common.serialization.Serializer<?> configureDelegate(Map<String, ?> configs, boolean isKey, org.apache.kafka.common.serialization.Serializer<?> delegate) Configure the delegate.protected booleanisInstance(Object instance) Return true if this object is an instance of T.byte[]byte[]Methods inherited from class org.springframework.kafka.support.serializer.DelegatingByTopicSerializationaddDelegate, build, buildDefault, close, findDelegate, instantiateAndConfigure, removeDelegate, setCaseSensitiveMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.serialization.Serializerclose
- 
Constructor Details- 
DelegatingByTopicSerializerpublic DelegatingByTopicSerializer()Construct an instance that will be configured inconfigure(Map, boolean)with producer propertiesDelegatingByTopicSerialization.VALUE_SERIALIZATION_TOPIC_CONFIGandDelegatingByTopicSerialization.KEY_SERIALIZATION_TOPIC_CONFIG.
- 
DelegatingByTopicSerializerpublic DelegatingByTopicSerializer(Map<Pattern, org.apache.kafka.common.serialization.Serializer<?>> delegates, org.apache.kafka.common.serialization.Serializer<?> defaultDelegate) Construct an instance with the supplied mapping of topic patterns to delegate serializers.- Parameters:
- delegates- the map of delegates.
- defaultDelegate- the default to use when no topic name match.
 
 
- 
- 
Method Details- 
configure- Specified by:
- configurein interface- org.apache.kafka.common.serialization.Serializer<Object>
- Overrides:
- configurein class- DelegatingByTopicSerialization<org.apache.kafka.common.serialization.Serializer<?>>
 
- 
configureDelegateprotected org.apache.kafka.common.serialization.Serializer<?> configureDelegate(Map<String, ?> configs, boolean isKey, org.apache.kafka.common.serialization.Serializer<?> delegate) Description copied from class:DelegatingByTopicSerializationConfigure the delegate.- Specified by:
- configureDelegatein class- DelegatingByTopicSerialization<org.apache.kafka.common.serialization.Serializer<?>>
- Parameters:
- configs- the configs.
- isKey- true if this is for keys.
- delegate- the delegate.
- Returns:
- the delegate.
 
- 
isInstanceDescription copied from class:DelegatingByTopicSerializationReturn true if this object is an instance of T.- Specified by:
- isInstancein class- DelegatingByTopicSerialization<org.apache.kafka.common.serialization.Serializer<?>>
- Parameters:
- instance- the delegate.
- Returns:
- true if a T.
 
- 
serialize
- 
serialize
 
-