RabbitMqServer
Assembly: ServiceStack.RabbitMq.dll
View Source
public class RabbitMqServer : IMessageService, IDisposable
Properties
ConnectionFactory
The RabbitMQ.Client Connection factory to introspect connection properties and create a low-level connection
View Source
public ConnectionFactory ConnectionFactory { get; }
AutoReconnect
Whether Rabbit MQ should auto-retry connecting when a connection to Rabbit MQ Server instance is dropped
View Source
public bool AutoReconnect { get; set; }
RetryCount
How many times a message should be retried before sending to the DLQ (Max of 1).
View Source
public int RetryCount { get; set; }
UsePolling
Whether to use polling for consuming messages instead of a long-term subscription
View Source
public bool UsePolling { get; set; }
KeepAliveRetryAfterMs
Wait before Starting the MQ Server after a restart
View Source
public int? KeepAliveRetryAfterMs { get; set; }
MessageFactory
View Source
public IMessageFactory MessageFactory { get; }
MqQueueClientFilter
View Source
public Action<RabbitMqQueueClient> MqQueueClientFilter { get; set; }
MqProducerFilter
View Source
public Action<RabbitMqProducer> MqProducerFilter { get; set; }
PublishMessageFilter
View Source
public Action<string, IBasicProperties, IMessage> PublishMessageFilter { get; set; }
GetMessageFilter
View Source
public Action<string, BasicGetResult> GetMessageFilter { get; set; }
CreateQueueFilter
View Source
public Action<string, Dictionary<string, object>> CreateQueueFilter { get; set; }
CreateTopicFilter
View Source
public Action<string, Dictionary<string, object>> CreateTopicFilter { get; set; }
RequestFilter
Execute global transformation or custom logic before a request is processed. Must be thread-safe.
View Source
public Func<IMessage, IMessage> RequestFilter { get; set; }
ResponseFilter
Execute global transformation or custom logic on the response. Must be thread-safe.
View Source
public Func<object, object> ResponseFilter { get; set; }
ErrorHandler
Execute global error handler logic. Must be thread-safe.
View Source
public Action<Exception> ErrorHandler { get; set; }
PriorityQueuesWhitelist
If you only want to enable priority queue handlers (and threads) for specific msg types
View Source
public string[] PriorityQueuesWhitelist { get; set; }
DisablePriorityQueues
Don't listen on any Priority Queues
View Source
public bool DisablePriorityQueues { set; }
PublishResponsesWhitelist
Opt-in to only publish responses on this white list. Publishes all responses by default.
View Source
public string[] PublishResponsesWhitelist { get; set; }
DisablePublishingResponses
Don't publish any response messages
View Source
public bool DisablePublishingResponses { set; }
PublishToOutqWhitelist
Opt-in to only publish .outq messages on this white list. Publishes all responses by default.
View Source
public string[] PublishToOutqWhitelist { get; set; }
DisablePublishingToOutq
Don't publish any messages to .outq
View Source
public bool DisablePublishingToOutq { set; }
RegisteredTypes
View Source
public List<Type> RegisteredTypes { get; }
BgThreadCount
View Source
public long BgThreadCount { get; }
Fields
DefaultRetryCount
View Source
public const int DefaultRetryCount = 1
Methods
RegisterHandler<T>(Func<IMessage<T>, Object>)
View Source
public virtual void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn)
Parameters
Type | Name |
---|---|
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object> | processMessageFn |
Type Parameters
T
RegisterHandler<T>(Func<IMessage<T>, Object>, Int32)
View Source
public virtual void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, int noOfThreads)
Parameters
Type | Name |
---|---|
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object> | processMessageFn |
System.Int32 | noOfThreads |
Type Parameters
T
RegisterHandler<T>(Func<IMessage<T>, Object>, Action<IMessageHandler, IMessage<T>, Exception>)
View Source
public virtual void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx)
Parameters
Type | Name |
---|---|
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object> | processMessageFn |
System.Action<ServiceStack.Messaging.IMessageHandler,ServiceStack.Messaging.IMessage<<T>>,System.Exception> | processExceptionEx |
Type Parameters
T
RegisterHandler<T>(Func<IMessage<T>, Object>, Action<IMessageHandler, IMessage<T>, Exception>, Int32)
View Source
public virtual void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx, int noOfThreads)
Parameters
Type | Name |
---|---|
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object> | processMessageFn |
System.Action<ServiceStack.Messaging.IMessageHandler,ServiceStack.Messaging.IMessage<<T>>,System.Exception> | processExceptionEx |
System.Int32 | noOfThreads |
Type Parameters
T
CreateMessageHandlerFactory<T>(Func<IMessage<T>, Object>, Action<IMessageHandler, IMessage<T>, Exception>)
View Source
protected IMessageHandlerFactory CreateMessageHandlerFactory<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx)
Returns
ServiceStack.Messaging.IMessageHandlerFactory
Parameters
Type | Name |
---|---|
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object> | processMessageFn |
System.Action<ServiceStack.Messaging.IMessageHandler,ServiceStack.Messaging.IMessage<<T>>,System.Exception> | processExceptionEx |
Type Parameters
T
GetStats()
View Source
public virtual IMessageHandlerStats GetStats()
Returns
ServiceStack.Messaging.IMessageHandlerStats
GetStatus()
View Source
public virtual string GetStatus()
Returns
System.String
GetStatsDescription()
View Source
public virtual string GetStatsDescription()
Returns
System.String
Init()
View Source
public virtual void Init()
Start()
View Source
public virtual void Start()
Stop()
View Source
public virtual void Stop()
WaitForWorkersToStop(Nullable<TimeSpan>)
View Source
public virtual void WaitForWorkersToStop(TimeSpan? timeout = null)
Parameters
Type | Name |
---|---|
System.Nullable<System.TimeSpan> | timeout |
Restart()
View Source
public virtual void Restart()
StartWorkerThreads()
View Source
public virtual void StartWorkerThreads()
StopWorkerThreads()
View Source
public virtual void StopWorkerThreads()
Dispose()
View Source
public virtual void Dispose()
Implements
- ServiceStack.Messaging.IMessageService
System.IDisposable