Skip to main content

BackgroundMqService

Assembly: ServiceStack.dll
View Source
Declaration
public class BackgroundMqService : IMessageService, IDisposable

Properties

RetryCount

How many times to retry processing messages before moving them to the DLQ

View Source
Declaration
public int RetryCount { get; set; }

RequestFilter

Execute global transformation or custom logic before a request is processed. Must be thread-safe.

View Source
Declaration
public Func<IMessage, IMessage> RequestFilter { get; set; }

ResponseFilter

Execute global transformation or custom logic on the response. Must be thread-safe.

View Source
Declaration
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
Declaration
public string[] PriorityQueuesWhitelist { get; set; }

EnablePriorityQueues

Create workers for priority queues

View Source
Declaration
public bool EnablePriorityQueues { set; }

DisablePriorityQueues

Disable Priority MQ's for Background MQ

View Source
Declaration
public bool DisablePriorityQueues { set; }

PublishResponsesWhitelist

Opt-in to only publish responses on this white list. Publishes all responses by default.

View Source
Declaration
public string[] PublishResponsesWhitelist { get; set; }

DisablePublishingResponses

Don't publish any response messages

View Source
Declaration
public bool DisablePublishingResponses { set; }

PublishToOutqWhitelist

Opt-in to only publish .outq messages on this white list. Publishes all responses by default.

View Source
Declaration
public string[] PublishToOutqWhitelist { get; set; }

DisablePublishingToOutq

Don't publish any messages to .outq

View Source
Declaration
public bool DisablePublishingToOutq { set; }

OutHandlers

Subscribe to messages sent to .outq

View Source
Declaration
public List<Action<string, IMessage>> OutHandlers { get; }

OutQMaxSize

The max size of the Out MQ Collection in each Type (default 100)

View Source
Declaration
public int OutQMaxSize { get; set; }

MessageFactory

View Source
Declaration
public IMessageFactory MessageFactory { get; }

RegisteredTypes

View Source
Declaration
public List<Type> RegisteredTypes { get; }

Methods

RegisterHandler<T>(Func<IMessage<T>, Object>)

View Source
Declaration
public void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn)
Parameters
TypeName
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object>processMessageFn
Type Parameters
  • T

RegisterHandler<T>(Func<IMessage<T>, Object>, Int32)

View Source
Declaration
public void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, int noOfThreads)
Parameters
TypeName
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object>processMessageFn
System.Int32noOfThreads
Type Parameters
  • T

RegisterHandler<T>(Func<IMessage<T>, Object>, Action<IMessageHandler, IMessage<T>, Exception>)

View Source
Declaration
public void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx)
Parameters
TypeName
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
Declaration
public void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx, int noOfThreads)
Parameters
TypeName
System.Func<ServiceStack.Messaging.IMessage<<T>>,System.Object>processMessageFn
System.Action<ServiceStack.Messaging.IMessageHandler,ServiceStack.Messaging.IMessage<<T>>,System.Exception>processExceptionEx
System.Int32noOfThreads
Type Parameters
  • T

CreateMessageHandlerFactory<T>(Func<IMessage<T>, Object>, Action<IMessageHandler, IMessage<T>, Exception>)

View Source
Declaration
protected IMessageHandlerFactory CreateMessageHandlerFactory<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessageHandler, IMessage<T>, Exception> processExceptionEx)
Returns

ServiceStack.Messaging.IMessageHandlerFactory

Parameters
TypeName
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
Declaration
public IMessageHandlerStats GetStats()
Returns

ServiceStack.Messaging.IMessageHandlerStats

GetWorkers(String)

View Source
Declaration
public IMqWorker[] GetWorkers(string queueName)
Returns

ServiceStack.Messaging.IMqWorker[]

Parameters
TypeName
System.StringqueueName

GetAllWorkers()

View Source
Declaration
public IMqWorker[] GetAllWorkers()
Returns

ServiceStack.Messaging.IMqWorker[]

GetStatus()

View Source
Declaration
public string GetStatus()
Returns

System.String

GetStatsDescription()

View Source
Declaration
public string GetStatsDescription()
Returns

System.String

GetCollection(Type)

View Source
Declaration
public IMqCollection GetCollection(Type type)
Returns

ServiceStack.Messaging.IMqCollection

Parameters
TypeName
System.Typetype

Publish(String, IMessage)

View Source
Declaration
public void Publish(string queueName, IMessage message)
Parameters
TypeName
System.StringqueueName
ServiceStack.Messaging.IMessagemessage

Notify(String, IMessage)

View Source
Declaration
public void Notify(string queueName, IMessage message)
Parameters
TypeName
System.StringqueueName
ServiceStack.Messaging.IMessagemessage

Get<T>(String, Nullable<TimeSpan>)

View Source
Declaration
public IMessage<T> Get<T>(string queueName, TimeSpan? timeout = null)
Returns

ServiceStack.Messaging.IMessage<T>

Parameters
TypeName
System.StringqueueName
System.Nullable<System.TimeSpan>timeout
Type Parameters
  • T

TryGet<T>(String)

View Source
Declaration
public IMessage<T> TryGet<T>(string queueName)
Returns

ServiceStack.Messaging.IMessage<T>

Parameters
TypeName
System.StringqueueName
Type Parameters
  • T

Start()

View Source
Declaration
public void Start()

Stop()

View Source
Declaration
public void Stop()

Dispose()

View Source
Declaration
public void Dispose()

Implements