RemoveCurrent(TimeSpan,MessageQueueTransactionType) Method
Removes the current message from a queue and returns the message to the calling application. If there is a message to remove, the method returns it immediately. Otherwise, the method waits the specified timeout for a new message to arrive.
Syntax
'Declaration Public Overloads Function RemoveCurrent( _ ByVal timeout As TimeSpan, _ ByVal transactionType As MessageQueueTransactionType _ ) As Message
'Usage Dim instance As MessageEnumerator Dim timeout As TimeSpan Dim transactionType As MessageQueueTransactionType Dim value As Message value = instance.RemoveCurrent(timeout, transactionType)
public Message RemoveCurrent( TimeSpan timeout, MessageQueueTransactionType transactionType )
public: Message^ RemoveCurrent( TimeSpan timeout, MessageQueueTransactionType transactionType )
Parameters
- timeout
- The interval of time to wait for the message to be removed.
- transactionType
- One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.
Return Value
A Message that references the first message available in the queue.
Exceptions
Exception | Description |
---|---|
System.ArgumentException | The value specified for the timeout parameter is invalid. |
MessageQueueException | The timeout has expired. |
System.ComponentModel.InvalidEnumArgumentException | The transactionType parameter is not one of the MessageQueueTransactionType members. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also