C# 클래스 Westwind.MessageQueueing.QueueMessageManagerMongoDb

An implementation of a MongoDb based multi-access Queue that provides random acccess to requests so they can be retrived for long running tasks where both client and server can interact with each message for processing. This implementation uses purely MongoDb server data access to handle the queue which works well for low to high volume loads. Great for long running tasks or even light workflow scenarios.
상속: QueueMessageManager
파일 보기 프로젝트 열기: RickStrahl/Westwind.QueueMessageManager

공개 메소드들

메소드 설명
ClearMessages ( System.TimeSpan messageTimeout = null ) : bool
CreateDatastore ( ) : bool
DeleteMessage ( string id ) : bool

Deletes an individual queue message by Id

DeleteWaitingMessages ( string queueName = null ) : bool

Deletes all messages that are waiting to be processed

Dispose ( ) : void

Clear data access component

GetCancelledMessages ( string queueName = null, int maxCount ) : IEnumerable
GetCompleteQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
GetNextQueueMessage ( string queueName = null ) : QueueMessageItem

Retrieves the next waiting Message from the Queue based on a provided queueName

GetPendingQueueMessages ( string queueName = null, int maxCount ) : IEnumerable

Retrieves all messages that are pending, that have started but not completed yet.

GetRecentQueueItems ( string queueName = null, int itemCount = 25 ) : IEnumerable

Returns a list of recent queue items

GetTimedOutQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
GetWaitingQueueMessageCount ( string queueName = null ) : int

Returns a count of messages that are waiting to be processed - this is the queue backup.

GetWaitingQueueMessages ( string queueName = null, int maxCount ) : IEnumerable

Returns a count of messages that are waiting to be processed - this is the queue backup.

IsCompleted ( string id = null ) : bool

Determines if anqueue has been completed successfully or failed. Note this method returns true if the request has completed or cancelled/failed. It just checks for completion.

Load ( string id ) : QueueMessageItem

Loads a Queue Message Item by its ID

QueueMessageManagerMongoDb ( ) : System
QueueMessageManagerMongoDb ( string connectionString ) : System
Save ( QueueMessageItem item = null ) : bool

Saves the passed message item or the attached item to the database. Call this after updating properties or individual values. Inserts or updates based on whether the ID exists

보호된 메소드들

메소드 설명
GetDatabase ( string connectionString = null, string databaseName = null ) : MongoDatabase

Creates a connection to a databaseName based on the Databasename and optional server connection string. Returned Mongo DatabaseName 'connection' can be cached and reused.

메소드 상세

ClearMessages() 공개 메소드

public ClearMessages ( System.TimeSpan messageTimeout = null ) : bool
messageTimeout System.TimeSpan
리턴 bool

CreateDatastore() 공개 메소드

public CreateDatastore ( ) : bool
리턴 bool

DeleteMessage() 공개 메소드

Deletes an individual queue message by Id
public DeleteMessage ( string id ) : bool
id string
리턴 bool

DeleteWaitingMessages() 공개 메소드

Deletes all messages that are waiting to be processed
public DeleteWaitingMessages ( string queueName = null ) : bool
queueName string
리턴 bool

Dispose() 공개 메소드

Clear data access component
public Dispose ( ) : void
리턴 void

GetCancelledMessages() 공개 메소드

public GetCancelledMessages ( string queueName = null, int maxCount ) : IEnumerable
queueName string
maxCount int
리턴 IEnumerable

GetCompleteQueueMessages() 공개 메소드

public GetCompleteQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
queueName string
maxCount int
리턴 IEnumerable

GetDatabase() 보호된 메소드

Creates a connection to a databaseName based on the Databasename and optional server connection string. Returned Mongo DatabaseName 'connection' can be cached and reused.
protected GetDatabase ( string connectionString = null, string databaseName = null ) : MongoDatabase
connectionString string Mongo server connection string. /// Can either be a connection string entry name from the ConnectionStrings /// section in the config file or a full server string. /// If not specified looks for connectionstring entry in same name as /// the context. Failing that mongodb://localhost is used. /// /// Examples: /// MyDatabaseConnectionString (ConnectionStrings Config Name) /// mongodb://localhost /// mongodb://localhost:22011/MyDatabase /// mongodb://username:password@localhost:22011/MyDatabase ///
databaseName string Name of the databaseName to work with if not specified on the connection string
리턴 MongoDatabase

GetNextQueueMessage() 공개 메소드

Retrieves the next waiting Message from the Queue based on a provided queueName
public GetNextQueueMessage ( string queueName = null ) : QueueMessageItem
queueName string Name of the queue
리턴 QueueMessageItem

GetPendingQueueMessages() 공개 메소드

Retrieves all messages that are pending, that have started but not completed yet.
public GetPendingQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
queueName string Name of the queue to return items for
maxCount int Optional - max number of items to return
리턴 IEnumerable

GetRecentQueueItems() 공개 메소드

Returns a list of recent queue items
public GetRecentQueueItems ( string queueName = null, int itemCount = 25 ) : IEnumerable
queueName string
itemCount int Max number of items to return
리턴 IEnumerable

GetTimedOutQueueMessages() 공개 메소드

public GetTimedOutQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
queueName string
maxCount int
리턴 IEnumerable

GetWaitingQueueMessageCount() 공개 메소드

Returns a count of messages that are waiting to be processed - this is the queue backup.
public GetWaitingQueueMessageCount ( string queueName = null ) : int
queueName string
리턴 int

GetWaitingQueueMessages() 공개 메소드

Returns a count of messages that are waiting to be processed - this is the queue backup.
public GetWaitingQueueMessages ( string queueName = null, int maxCount ) : IEnumerable
queueName string
maxCount int
리턴 IEnumerable

IsCompleted() 공개 메소드

Determines if anqueue has been completed successfully or failed. Note this method returns true if the request has completed or cancelled/failed. It just checks for completion.
public IsCompleted ( string id = null ) : bool
id string
리턴 bool

Load() 공개 메소드

Loads a Queue Message Item by its ID
public Load ( string id ) : QueueMessageItem
id string
리턴 QueueMessageItem

QueueMessageManagerMongoDb() 공개 메소드

public QueueMessageManagerMongoDb ( ) : System
리턴 System

QueueMessageManagerMongoDb() 공개 메소드

public QueueMessageManagerMongoDb ( string connectionString ) : System
connectionString string
리턴 System

Save() 공개 메소드

Saves the passed message item or the attached item to the database. Call this after updating properties or individual values. Inserts or updates based on whether the ID exists
public Save ( QueueMessageItem item = null ) : bool
item QueueMessageItem
리턴 bool