Table of Contents

Class DefaultPollableMessageSource

Namespace
Steeltoe.Stream.Binder
Assembly
Steeltoe.Stream.StreamBase.dll
public class DefaultPollableMessageSource : AbstractPollableSource<IMessageHandler>, IPollableMessageSource, IPollableSource<IMessageHandler>, IPollableSource, ILifecycle, IRetryListener
Inheritance
DefaultPollableMessageSource
Implements
Inherited Members

Constructors

DefaultPollableMessageSource(IApplicationContext, ISmartMessageConverter)

public DefaultPollableMessageSource(IApplicationContext context, ISmartMessageConverter messageConverter)

Parameters

context IApplicationContext
messageConverter ISmartMessageConverter

Properties

AttributeProvider

public Action<IAttributeAccessor, IMessage> AttributeProvider { get; set; }

Property Value

Action<IAttributeAccessor, IMessage>

ErrorChannel

public IMessageChannel ErrorChannel { get; set; }

Property Value

IMessageChannel

ErrorMessageStrategy

public IErrorMessageStrategy ErrorMessageStrategy { get; set; }

Property Value

IErrorMessageStrategy

IsRunning

Gets a value indicating whether gets a value indicating if its running

public bool IsRunning { get; }

Property Value

bool

RecoveryCallback

public IRecoveryCallback RecoveryCallback { get; set; }

Property Value

IRecoveryCallback

RetryTemplate

public RetryTemplate RetryTemplate { get; set; }

Property Value

RetryTemplate

Source

public IMessageSource Source { get; set; }

Property Value

IMessageSource

Methods

AddInterceptor(IChannelInterceptor)

public void AddInterceptor(IChannelInterceptor interceptor)

Parameters

interceptor IChannelInterceptor

AddInterceptor(int, IChannelInterceptor)

public void AddInterceptor(int index, IChannelInterceptor interceptor)

Parameters

index int
interceptor IChannelInterceptor

Close(IRetryContext, Exception)

Called after the final attempt (successful or not).

public void Close(IRetryContext context, Exception exception)

Parameters

context IRetryContext

the current retry context

exception Exception

the last exception that was thrown during retry

OnError(IRetryContext, Exception)

Called after every unsuccessful attempt at a retry.

public void OnError(IRetryContext context, Exception exception)

Parameters

context IRetryContext

the current retry context

exception Exception

the last exception that was thrown during retry

Open(IRetryContext)

Called before the first attempt in a retry.

public bool Open(IRetryContext context)

Parameters

context IRetryContext

the current retry context

Returns

bool

true if the retry should proceed

Poll(IMessageHandler)

Poll the consumer

public override bool Poll(IMessageHandler handler)

Parameters

handler IMessageHandler

the handler to process message

Returns

bool

true if a message was handled

Poll(IMessageHandler, Type)

Poll the consumer and convert the payload to the specified type. Throw a RequeueCurrentMessageException to force the current message to be requeued in the broker(after retries are exhausted, if configured).

public override bool Poll(IMessageHandler handler, Type type)

Parameters

handler IMessageHandler

the handler

type Type

the type of the payload

Returns

bool

true if a message was handled

ShouldRequeue(Exception)

protected static bool ShouldRequeue(Exception e)

Parameters

e Exception

Returns

bool

Start()

Start this component

public Task Start()

Returns

Task

a task to signal completion

Stop()

Stop this component

public Task Stop()

Returns

Task

a task to signal completion