Class DefaultStreamMessageConverter
java.lang.Object
org.springframework.rabbit.stream.support.converter.DefaultStreamMessageConverter
- All Implemented Interfaces:
MessageConverter
,StreamMessageConverter
Default
StreamMessageConverter
.- Since:
- 2.4
- Author:
- Gary Russell, Ngoc Nhan
-
Constructor Summary
ConstructorDescriptionConstruct an instance using aWrapperMessageBuilder
.DefaultStreamMessageConverter
(com.rabbitmq.stream.Codec codec) Construct an instance using the provided codec. -
Method Summary
Modifier and TypeMethodDescriptioncom.rabbitmq.stream.Message
fromMessage
(Message message) Convert from a Message to a Java object.void
setBuilderSupplier
(Supplier<com.rabbitmq.stream.MessageBuilder> builderSupplier) Set a supplier for a message builder.toMessage
(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 Details
-
DefaultStreamMessageConverter
public DefaultStreamMessageConverter()Construct an instance using aWrapperMessageBuilder
. -
DefaultStreamMessageConverter
Construct an instance using the provided codec.- Parameters:
codec
- the codec.
-
-
Method Details
-
setBuilderSupplier
Set a supplier for a message builder.- Parameters:
builderSupplier
- the supplier.
-
toMessage
public Message toMessage(Object object, StreamMessageProperties messageProperties) throws MessageConversionException - Specified by:
toMessage
in interfaceStreamMessageConverter
- Throws:
MessageConversionException
-
fromMessage
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
-