cleanMessageQueue: Removes messages matching query from queue.

cleanMessageQueueR Documentation

Removes messages matching query from queue.

Description

Often a queue will contain a number of messages which do not get processed. This function cleans out messages from the queue. This is typically called both before (called “cleaning”) importing new messages (see importMessages) and after (called “purging”).

Usage

cleanMessageQueue(queue, query)
## S4 method for signature 'MongoQueue'
cleanMessageQueue(queue, query)

Arguments

queue

An object of class MessageQueue to be cleaned.

query

A list which forms a Mongo query for selecting the messages to be removed. See buildJQuery.

Value

Return value is undefined. Called for its side effects (removing messages from database collection).

Will log and throw database errors.

Note

Generates log entries using 'futile.logger'.

Currently no method for 'ListQueue' objects.

Author(s)

Russell Almond

See Also

MongoQueue

Examples

  mq <- new("MongoQueue","QueueTest",mongo::MongoDB("Messages",noMongo=TRUE),
                   builder=buildMessage)
  ## Remove Fred's messages from the database.
  cleanMessageQueue(mq,list(c(uid="Fred")))
  ## Purge NO-OP messages from the imported data.
  cleanMessageQueue(mq,list(c(mess="NO-OP")))


ralmond/Proc4 documentation built on June 13, 2025, 7:13 a.m.