Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Removes the current message from the queue and returns the message to the calling application. Removing the message deletes it from the queue.
RemoveCurrent() |
Removes the current message from a transactional or non-transactional queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue. |
RemoveCurrent(MessageQueueTransaction) |
Removes the current message from a transactional queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue. |
RemoveCurrent(MessageQueueTransactionType) |
Removes the current message from a queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue. |
RemoveCurrent(TimeSpan) |
Removes the current message from the 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. |
RemoveCurrent(TimeSpan, MessageQueueTransaction) |
Removes the current message from a transactional 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. |
RemoveCurrent(TimeSpan, MessageQueueTransactionType) |
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. |
The behavior described for these overloads is applicable only if the MessageEnumerator instance is retrieved by using the GetMessageEnumerator2. Do not use GetMessageEnumerator to retrieve an instance of MessageEnumerator as this method has been deprecated.
Removes the current message from a transactional or non-transactional queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue.
public:
System::Messaging::Message ^ RemoveCurrent();
public System.Messaging.Message RemoveCurrent();
member this.RemoveCurrent : unit -> System.Messaging.Message
Public Function RemoveCurrent () As Message
A Message that references the first message available in the queue.
RemoveCurrent removes and returns the message at the cursor's current location.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
If you call this overload on a transactional queue, Message Queuing creates a single internal transaction.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Removes the current message from a transactional queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue.
public:
System::Messaging::Message ^ RemoveCurrent(System::Messaging::MessageQueueTransaction ^ transaction);
public System.Messaging.Message RemoveCurrent(System.Messaging.MessageQueueTransaction transaction);
member this.RemoveCurrent : System.Messaging.MessageQueueTransaction -> System.Messaging.Message
Public Function RemoveCurrent (transaction As MessageQueueTransaction) As Message
The MessageQueueTransaction object that specifies the transaction in which the message will be removed.
A Message that references the first message available in the queue.
The transaction
parameter is null
.
RemoveCurrent removes and returns the message at the cursor's current location, using the internal transaction context defined by the transaction
parameter.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When working with transactional queues, a rollback of a transaction causes any messages removed by a call to RemoveCurrent to be returned to the queue. The removal is not irreversible until the transaction is committed.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Removes the current message from a queue and returns the message to the calling application. There is no timeout specified for a message to arrive in the queue.
public:
System::Messaging::Message ^ RemoveCurrent(System::Messaging::MessageQueueTransactionType transactionType);
public System.Messaging.Message RemoveCurrent(System.Messaging.MessageQueueTransactionType transactionType);
member this.RemoveCurrent : System.Messaging.MessageQueueTransactionType -> System.Messaging.Message
Public Function RemoveCurrent (transactionType As MessageQueueTransactionType) As Message
One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.
A Message that references the first message available in the queue.
The transactionType
parameter is not one of the MessageQueueTransactionType members.
RemoveCurrent removes and returns the message at the cursor's current location, using a transaction context defined by the transactionType
parameter.
Specify Automatic
for the transactionType
parameter if there is already an external transaction context attached to the thread that you want to use to receive the message. Specify Single
if you want to receive the message as a single internal transaction. You can specify None
if you want to receive a message from a transactional queue outside of a transaction context.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When working with transactional queues, a rollback of a transaction causes any messages removed by a call to RemoveCurrent to be returned to the queue. The removal is not irreversible until the transaction is committed.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Removes the current message from the 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.
public:
System::Messaging::Message ^ RemoveCurrent(TimeSpan timeout);
public System.Messaging.Message RemoveCurrent(TimeSpan timeout);
member this.RemoveCurrent : TimeSpan -> System.Messaging.Message
Public Function RemoveCurrent (timeout As TimeSpan) As Message
The interval of time to wait for a message to arrive in the queue.
A Message that references the first message available in the queue.
The value specified for the timeout
parameter is invalid.
The timeout has expired.
RemoveCurrent removes and returns the message at the cursor's current location. If the cursor is at the end of the queue, this overload of the method waits until a message is available or the interval specified by the timeout
parameter has expired.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
If you call this overload on a transactional queue, Message Queuing creates a single internal transaction.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Removes the current message from a transactional 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.
public:
System::Messaging::Message ^ RemoveCurrent(TimeSpan timeout, System::Messaging::MessageQueueTransaction ^ transaction);
public System.Messaging.Message RemoveCurrent(TimeSpan timeout, System.Messaging.MessageQueueTransaction transaction);
member this.RemoveCurrent : TimeSpan * System.Messaging.MessageQueueTransaction -> System.Messaging.Message
Public Function RemoveCurrent (timeout As TimeSpan, transaction As MessageQueueTransaction) As Message
The interval of time to wait for the message to be removed.
The MessageQueueTransaction object that specifies the transaction context for the message.
A Message that references the first message available in the queue.
The value specified for the timeout
parameter is invalid.
The transaction
parameter is null
.
The timeout has expired.
RemoveCurrent removes and returns the message at the cursor's current location. If the cursor is at the end of the queue, this overload of the method waits until a message is available or the interval specified by the timeout
parameter has expired.
When working with transactional queues, a rollback of a transaction causes any messages removed by a call to RemoveCurrent to be returned to the queue. The removal is not irreversible until the transaction is committed.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
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.
public:
System::Messaging::Message ^ RemoveCurrent(TimeSpan timeout, System::Messaging::MessageQueueTransactionType transactionType);
public System.Messaging.Message RemoveCurrent(TimeSpan timeout, System.Messaging.MessageQueueTransactionType transactionType);
member this.RemoveCurrent : TimeSpan * System.Messaging.MessageQueueTransactionType -> System.Messaging.Message
Public Function RemoveCurrent (timeout As TimeSpan, transactionType As MessageQueueTransactionType) As Message
The interval of time to wait for the message to be removed.
One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.
A Message that references the first message available in the queue.
The value specified for the timeout
parameter is invalid.
The timeout has expired.
The transactionType
parameter is not one of the MessageQueueTransactionType members.
RemoveCurrent removes and returns the message at the cursor's current location, using a transaction context defined by the transactionType
parameter. If the cursor is at the end of the queue, this overload of the method waits until a message is available or the interval specified by the timeout
parameter has expired.
Specify Automatic
for the transactionType
parameter if there is already an external transaction context attached to the thread that you want to use to receive the message. Specify Single
if you want to receive the message as a single internal transaction. You can specify None
if you want to receive a message from a transactional queue outside of a transaction context.
If you are using queue journaling, removing the message causes a copy to be kept in the journal queue, just as the MessageQueue class's Receive method does.
When working with transactional queues, a rollback of a transaction causes any messages removed by a call to RemoveCurrent to be returned to the queue. The removal is not irreversible until the transaction is committed.
When you remove the current message, the cursor is moved to the next message. You do not have to call MoveNext after calling RemoveCurrent.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in