Class DefaultPollableMessageSource
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
IApplicationContextmessageConverter
ISmartMessageConverter
Properties
AttributeProvider
public Action<IAttributeAccessor, IMessage> AttributeProvider { get; set; }
Property Value
ErrorChannel
public IMessageChannel ErrorChannel { get; set; }
Property Value
ErrorMessageStrategy
public IErrorMessageStrategy ErrorMessageStrategy { get; set; }
Property Value
IsRunning
Gets a value indicating whether gets a value indicating if its running
public bool IsRunning { get; }
Property Value
RecoveryCallback
public IRecoveryCallback RecoveryCallback { get; set; }
Property Value
RetryTemplate
public RetryTemplate RetryTemplate { get; set; }
Property Value
Source
public IMessageSource Source { get; set; }
Property Value
Methods
AddInterceptor(IChannelInterceptor)
public void AddInterceptor(IChannelInterceptor interceptor)
Parameters
interceptor
IChannelInterceptor
AddInterceptor(int, IChannelInterceptor)
public void AddInterceptor(int index, IChannelInterceptor interceptor)
Parameters
index
intinterceptor
IChannelInterceptor
Close(IRetryContext, Exception)
Called after the final attempt (successful or not).
public void Close(IRetryContext context, Exception exception)
Parameters
context
IRetryContextthe current retry context
exception
Exceptionthe 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
IRetryContextthe current retry context
exception
Exceptionthe last exception that was thrown during retry
Open(IRetryContext)
Called before the first attempt in a retry.
public bool Open(IRetryContext context)
Parameters
context
IRetryContextthe current retry context
Returns
- bool
true if the retry should proceed
Poll(IMessageHandler)
Poll the consumer
public override bool Poll(IMessageHandler handler)
Parameters
handler
IMessageHandlerthe 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
IMessageHandlerthe handler
type
Typethe type of the payload
Returns
- bool
true if a message was handled
ShouldRequeue(Exception)
protected static bool ShouldRequeue(Exception e)
Parameters
Returns
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