An interface for components which queue binary messages. A queue may be implemented using a transient or persistent storage mechanism, depending on the quality of service required by the user.
Return the next message in the queue, and mark the message as being "in progress", so that subsequent calls to dequeue return subsequent messages. If the queue is empty, this call should block until a message is available.
void dequeue ( out CtsServices::MessageId id, out CtsServices::Message msg );
Enqueue a binary message with an id that was previously generated
by a call to
newMessageId. Has no effect if this
message id has already been enqueued, i.e. enqueue can be called
multiple times with the same MessageId, and only the first such
call has any effect.
void enqueue ( in CtsServices::MessageId id, in CtsServices::Message msg );
Remove a message from the queue. This method will run in its own new transaction.
void failure ( in CtsServices::MessageId id, in string reason );
Generate a new, unique, MessageId that may be
subsequently passed to
CtsServices::MessageId newMessageId ( );
Called on server startup to recover messages which were left in the "in progress" state from a previous run of the server. If the queue is transient (in memory), this call has no effect.
void recover ( );
Remove a message from the queue. This method will run in the same transaction as the user code which is invoked by processing the message (the user code is invoked first).
void success ( in CtsServices::MessageId id );