Interface IMessageConverter
A converter to turn the payload of a message from serialized form to a typed object and vice versa.
[Obsolete("This feature will be removed in the next major version. See https://steeltoe.io/docs/v3/obsolete for details.")]
public interface IMessageConverter : IServiceNameAware
- Inherited Members
Methods
FromMessage(IMessage, Type)
Convert the payload of a message to a typed object.
object FromMessage(IMessage message, Type targetClass)
Parameters
Returns
- object
the result of the conversion
FromMessage<T>(IMessage)
Convert the payload of a message to a typed object.
T FromMessage<T>(IMessage message)
Parameters
messageIMessagethe input message
Returns
- T
the result of the conversion
Type Parameters
Tthe target type for the conversion
ToMessage(object, IMessageHeaders)
Create a message whose payload is the result of converting the given payload object to serialized form.
IMessage ToMessage(object payload, IMessageHeaders headers)
Parameters
payloadobjectthe object to convert
headersIMessageHeadersoptional headers for the message
Returns
- IMessage
the new messagee or null if converter does not support the payload type