Class ConsumerRecordConverter
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.converters.ConsumerRecordConverter
-
- All Implemented Interfaces:
MessageConverter,javax.enterprise.inject.spi.Prioritized
@ApplicationScoped public class ConsumerRecordConverter extends Object implements MessageConverter
Convert an incoming Kafka message into aConsumerRecord.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.smallrye.reactive.messaging.MessageConverter
MessageConverter.IdentityConverter
-
-
Field Summary
-
Fields inherited from interface io.smallrye.reactive.messaging.MessageConverter
CONVERTER_DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ConsumerRecordConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvert(Message<?> in, Type target)Checks whether this instance of converter can convert the given messageininto aMessage<T>withTbeing the type represented bytarget.Message<?>convert(Message<?> in, Type target)Converts the given messageininto aMessage<T>.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.MessageConverter
getPriority
-
-
-
-
Method Detail
-
canConvert
public boolean canConvert(Message<?> in, Type target)
Description copied from interface:MessageConverterChecks whether this instance of converter can convert the given messageininto aMessage<T>withTbeing the type represented bytarget. When reactive messaging looks for a converter, it picks the first converter returningtruefor a given message.- Specified by:
canConvertin interfaceMessageConverter- Parameters:
in- the input message, notnulltarget- the target type, generally the type ingested by a method- Returns:
trueif the conversion is possible,falseotherwise.
-
convert
public Message<?> convert(Message<?> in, Type target)
Description copied from interface:MessageConverterConverts the given messageininto aMessage<T>. This method is only called after a successful call toMessageConverter.canConvert(Message, Type)with the given target type.- Specified by:
convertin interfaceMessageConverter- Parameters:
in- the input messagetarget- the target type- Returns:
- the converted message.
-
-