Table of Contents

Interface ISmartMessageConverter

Namespace
Steeltoe.Messaging.Converter
Assembly
Steeltoe.Messaging.Abstractions.dll

An extended message converter supporting conversion hints

public interface ISmartMessageConverter : IMessageConverter, IServiceNameAware
Inherited Members

Methods

FromMessage(IMessage, Type, object)

Convert the payload of a message to a typed object.

object FromMessage(IMessage message, Type targetClass, object conversionHint)

Parameters

message IMessage

the input message

targetClass Type

the target type of the conversion

conversionHint object

an extra object passed to the converter which may used for handling the conversion

Returns

object

the result of the conversion

FromMessage<T>(IMessage, object)

Convert the payload of a message to a typed object.

T FromMessage<T>(IMessage message, object conversionHint)

Parameters

message IMessage

the input message

conversionHint object

an extra object passed to the converter which may used for handling the conversion

Returns

T

the result of the conversion

Type Parameters

T

the target type for the conversion

ToMessage(object, IMessageHeaders, object)

Create a message whose payload is the result of converting the given payload object to serialized form.

IMessage ToMessage(object payload, IMessageHeaders headers, object conversionHint)

Parameters

payload object

the object to convert

headers IMessageHeaders

optional headers for the message

conversionHint object

an extra object passed to the converter which may used for handling the conversion

Returns

IMessage

the new messagee or null if converter does not support the payload type