Class DefaultStreamMessageConverter
- java.lang.Object
-
- org.springframework.rabbit.stream.support.converter.DefaultStreamMessageConverter
-
- All Implemented Interfaces:
MessageConverter
,StreamMessageConverter
public class DefaultStreamMessageConverter extends java.lang.Object implements StreamMessageConverter
DefaultStreamMessageConverter
.- Since:
- 2.4
- Author:
- Gary Russell
-
-
Constructor Summary
Constructors Constructor Description DefaultStreamMessageConverter()
Construct an instance using aWrapperMessageBuilder
.DefaultStreamMessageConverter(com.rabbitmq.stream.Codec codec)
Construct an instance using the provided codec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.rabbitmq.stream.Message
fromMessage(Message message)
Convert from a Message to a Java object.void
setBuilderSupplier(java.util.function.Supplier<com.rabbitmq.stream.MessageBuilder> builderSupplier)
Set a supplier for a message builder.Message
toMessage(java.lang.Object object, StreamMessageProperties messageProperties)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.amqp.support.converter.MessageConverter
toMessage
-
Methods inherited from interface org.springframework.rabbit.stream.support.converter.StreamMessageConverter
toMessage
-
-
-
-
Constructor Detail
-
DefaultStreamMessageConverter
public DefaultStreamMessageConverter()
Construct an instance using aWrapperMessageBuilder
.
-
DefaultStreamMessageConverter
public DefaultStreamMessageConverter(@Nullable com.rabbitmq.stream.Codec codec)
Construct an instance using the provided codec.- Parameters:
codec
- the codec.
-
-
Method Detail
-
setBuilderSupplier
public void setBuilderSupplier(java.util.function.Supplier<com.rabbitmq.stream.MessageBuilder> builderSupplier)
Set a supplier for a message builder.- Parameters:
builderSupplier
- the supplier.
-
toMessage
public Message toMessage(java.lang.Object object, StreamMessageProperties messageProperties) throws MessageConversionException
- Specified by:
toMessage
in interfaceStreamMessageConverter
- Throws:
MessageConversionException
-
fromMessage
public com.rabbitmq.stream.Message fromMessage(Message message) throws MessageConversionException
Description copied from interface:MessageConverter
Convert from a Message to a Java object.- Specified by:
fromMessage
in interfaceMessageConverter
- Specified by:
fromMessage
in interfaceStreamMessageConverter
- Parameters:
message
- the message to convert- Returns:
- the converted Java object
- Throws:
MessageConversionException
- in case of conversion failure
-
-