MessageEnumerator.RemoveCurrent Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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.

Namespace:   System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public Message RemoveCurrent()

Return Value

Type: System.Messaging.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.

.NET Framework
Available since 1.1
Return to top