BackgroundMqService
Assembly: ServiceStack.dll
View Source
public class BackgroundMqService : IMessageService, IDisposable
Properties
RetryCount
How many times to retry processing messages before moving them to the DLQ
View Source
public int RetryCount { 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; }
PriorityQueuesWhitelist
If you only want to enable priority queue handlers (and threads) for specific msg types
View Source
public string[] PriorityQueuesWhitelist { get; set; }
EnablePriorityQueues
Create workers for priority queues
View Source
public bool EnablePriorityQueues { set; }
DisablePriorityQueues
Disable Priority MQ's for Background MQ
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; }
OutHandlers
Subscribe to messages sent to .outq
View Source
public List<Action<string, IMessage>> OutHandlers { get; }
OutQMaxSize
The max size of the Out MQ Collection in each Type (default 100)
View Source
public int OutQMaxSize { get; set; }
MessageFactory
View Source
public IMessageFactory MessageFactory { get; }
RegisteredTypes
View Source
public List<Type> RegisteredTypes { get; }
Methods
RegisterHandler<T>(Func<IMessage<T>, Object>)
View Source
public 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 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 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 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 IMessageHandlerStats GetStats()
Returns
ServiceStack.Messaging.IMessageHandlerStats
GetWorkers(String)
View Source
public IMqWorker[] GetWorkers(string queueName)
Returns
ServiceStack.Messaging.IMqWorker[]
Parameters
Type | Name |
---|---|
System.String | queueName |
GetAllWorkers()
View Source
public IMqWorker[] GetAllWorkers()
Returns
ServiceStack.Messaging.IMqWorker[]
GetStatus()
View Source
public string GetStatus()
Returns
System.String
GetStatsDescription()
View Source
public string GetStatsDescription()
Returns
System.String
GetCollection(Type)
View Source
public IMqCollection GetCollection(Type type)
Returns
ServiceStack.Messaging.IMqCollection
Parameters
Type | Name |
---|---|
System.Type | type |
Publish(String, IMessage)
View Source
public void Publish(string queueName, IMessage message)
Parameters
Type | Name |
---|---|
System.String | queueName |
ServiceStack.Messaging.IMessage | message |
Notify(String, IMessage)
View Source
public void Notify(string queueName, IMessage message)
Parameters
Type | Name |
---|---|
System.String | queueName |
ServiceStack.Messaging.IMessage | message |
Get<T>(String, Nullable<TimeSpan>)
View Source
public IMessage<T> Get<T>(string queueName, TimeSpan? timeout = null)
Returns
ServiceStack.Messaging.IMessage<T>
Parameters
Type | Name |
---|---|
System.String | queueName |
System.Nullable<System.TimeSpan> | timeout |
Type Parameters
T
TryGet<T>(String)
View Source
public IMessage<T> TryGet<T>(string queueName)
Returns
ServiceStack.Messaging.IMessage<T>
Parameters
Type | Name |
---|---|
System.String | queueName |
Type Parameters
T
Start()
View Source
public void Start()
Stop()
View Source
public void Stop()
Dispose()
View Source
public void Dispose()
Implements
- ServiceStack.Messaging.IMessageService
System.IDisposable