Table of Contents

Class AbstractMessageConverter

Namespace
Steeltoe.Messaging.RabbitMQ.Support.Converter
Assembly
Steeltoe.Messaging.RabbitMQ.dll
public abstract class AbstractMessageConverter : ISmartMessageConverter, IMessageConverter, IServiceNameAware
Inheritance
AbstractMessageConverter
Implements
Derived
Inherited Members

Constructors

AbstractMessageConverter(ILogger)

protected AbstractMessageConverter(ILogger logger = null)

Parameters

logger ILogger

Fields

_logger

protected readonly ILogger _logger

Field Value

ILogger

Properties

CreateMessageIds

public bool CreateMessageIds { get; set; }

Property Value

bool

ServiceName

public abstract string ServiceName { get; set; }

Property Value

string

Methods

CreateMessage(object, IMessageHeaders)

protected virtual IMessage CreateMessage(object payload, IMessageHeaders messageProperties)

Parameters

payload object
messageProperties IMessageHeaders

Returns

IMessage

CreateMessage(object, IMessageHeaders, object)

protected abstract IMessage CreateMessage(object payload, IMessageHeaders messageProperties, object conversionHint)

Parameters

payload object
messageProperties IMessageHeaders
conversionHint object

Returns

IMessage

FromMessage(IMessage, Type)

Convert the payload of a message to a typed object.

public object FromMessage(IMessage message, Type targetClass)

Parameters

message IMessage

the input message

targetClass Type

the target type for the conversion

Returns

object

the result of the conversion

FromMessage(IMessage, Type, object)

Convert the payload of a message to a typed object.

public abstract 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)

Convert the payload of a message to a typed object.

public T FromMessage<T>(IMessage message)

Parameters

message IMessage

the input message

Returns

T

the result of the conversion

Type Parameters

T

the target type for the conversion

FromMessage<T>(IMessage, object)

Convert the payload of a message to a typed object.

public 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)

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

public IMessage ToMessage(object payload, IMessageHeaders messageProperties)

Parameters

payload object

the object to convert

messageProperties IMessageHeaders

Returns

IMessage

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

ToMessage(object, IMessageHeaders, object)

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

public 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