Table of Contents

Class AbstractMessageChannel

Namespace
Steeltoe.Integration.Channel
Assembly
Steeltoe.Integration.IntegrationBase.dll
public abstract class AbstractMessageChannel : Channel<IMessage>, IMessageChannel, IServiceNameAware, IChannelInterceptorAware
Inheritance
AbstractMessageChannel
Implements
Derived
Inherited Members

Constructors

AbstractMessageChannel(IApplicationContext, ILogger)

protected AbstractMessageChannel(IApplicationContext context, ILogger logger = null)

Parameters

context IApplicationContext
logger ILogger

AbstractMessageChannel(IApplicationContext, string, ILogger)

protected AbstractMessageChannel(IApplicationContext context, string name, ILogger logger = null)

Parameters

context IApplicationContext
name string
logger ILogger

Fields

INDEFINITE_TIMEOUT

protected const int INDEFINITE_TIMEOUT = -1

Field Value

int

logger

protected ILogger logger

Field Value

ILogger

Properties

ApplicationContext

public IApplicationContext ApplicationContext { get; }

Property Value

IApplicationContext

ChannelInterceptors

Gets or sets the channel interceptors

public virtual List<IChannelInterceptor> ChannelInterceptors { get; set; }

Property Value

List<IChannelInterceptor>

ComponentName

public virtual string ComponentName { get; set; }

Property Value

string

ComponentType

public virtual string ComponentType { get; }

Property Value

string

DataTypes

public virtual List<Type> DataTypes { get; set; }

Property Value

List<Type>

IntegrationServices

public IIntegrationServices IntegrationServices { get; }

Property Value

IIntegrationServices

MessageConverter

public virtual IMessageConverter MessageConverter { get; set; }

Property Value

IMessageConverter

ServiceName

public virtual string ServiceName { get; set; }

Property Value

string

Methods

AddInterceptor(IChannelInterceptor)

Add a interceptor to the channel

public virtual void AddInterceptor(IChannelInterceptor interceptor)

Parameters

interceptor IChannelInterceptor

the interceptor

AddInterceptor(int, IChannelInterceptor)

Add an interceptor to the channel at the specified index

public virtual void AddInterceptor(int index, IChannelInterceptor interceptor)

Parameters

index int

the index to add the interceptor at

interceptor IChannelInterceptor

the interceptor

DoSend(IMessage, int)

protected virtual bool DoSend(IMessage message, int timeout)

Parameters

message IMessage
timeout int

Returns

bool

DoSend(IMessage, CancellationToken)

protected bool DoSend(IMessage message, CancellationToken cancellationToken)

Parameters

message IMessage
cancellationToken CancellationToken

Returns

bool

DoSendInternal(IMessage, CancellationToken)

protected abstract bool DoSendInternal(IMessage message, CancellationToken cancellationToken)

Parameters

message IMessage
cancellationToken CancellationToken

Returns

bool

RemoveInterceptor(IChannelInterceptor)

Remove an intercetptor from the channel

public virtual bool RemoveInterceptor(IChannelInterceptor interceptor)

Parameters

interceptor IChannelInterceptor

the interceptor

Returns

bool

succss or failure

RemoveInterceptor(int)

Remove an interceptor at the specified index

public virtual IChannelInterceptor RemoveInterceptor(int index)

Parameters

index int

the index

Returns

IChannelInterceptor

removed interceptor

Send(IMessage)

Send a message to this channel. If the message is sent successfuly, the method returns true. If the message cannot be sent due to a non-fatal reason, the method returns false. The method may also throw a Exception in case of non-recoverable errors. This method may block indefinitely, depending on the implementation.

public virtual bool Send(IMessage message)

Parameters

message IMessage

the message to send

Returns

bool

true if the message is sent

Send(IMessage, int)

Send a message, blocking until either the message is accepted or the specified timeout period elapses.

public virtual bool Send(IMessage message, int timeout)

Parameters

message IMessage

the message to send

timeout int

the timeout in milliseconds; -1 for no timeout

Returns

bool

true if the message is sent

SendAsync(IMessage, CancellationToken)

Send a message to this channel.

public ValueTask<bool> SendAsync(IMessage message, CancellationToken cancellationToken = default)

Parameters

message IMessage

the message to send

cancellationToken CancellationToken

token used to signal cancellation

Returns

ValueTask<bool>

a task to signal completion