QueueClient.PeekLockMultiple Method (Int32)

[This is prerelease documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Locks and retrieves up to the specified number of messages from the queue.

Namespace: Microsoft.ServiceBus
Assembly: Microsoft.ServiceBus (in microsoft.servicebus.dll)

Usage

    Dim instance As QueueClient
Dim maxMessages As Integer
Dim returnValue As IEnumerable(Of Message)

returnValue = instance.PeekLockMultiple(maxMessages)

Syntax

'Declaration
Public Function PeekLockMultiple ( _
    maxMessages As Integer _
) As IEnumerable(Of Message)
public IEnumerable<Message> PeekLockMultiple (
    int maxMessages
)
public:
IEnumerable<Message^>^ PeekLockMultiple (
    int maxMessages
)
public IEnumerable<Message> PeekLockMultiple (
    int maxMessages
)
public function PeekLockMultiple (
    maxMessages : int
) : IEnumerable<Message>

Parameters

  • maxMessages
    The maximum number of messages to retrieve from the queue. The service may return fewer than the indicated number of messages to balance timeliness of retrieval and bandwidth concerns even if the queue holds more messages than the indicated maximum number.

Return Value

Returns a IEnumerable that contains the messages.

Remarks

PeekLockMultiple(Int32) blocks until at least one message can be retrieved from the queue. Whenever the receiver has processed any message from the received set of messages, it must call DeleteLockedMessage for the message to indicate that it has consumed and processed the message. If the receiver cannot process the message it should call ReleaseLock for the message to restore the message into the Queue. If the client fails to delete a locked message, the message is automatically restored into the Queue after 60 seconds. There are no interdependencies between messages retrieved in a set. Each message must be deleted or unlocked separately.

The operation requires ‘Listen’ permission on the Queue.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 , Windows Server 2008, and Windows 2000

Target Platforms

See Also

Reference

QueueClient Class
QueueClient Members
Microsoft.ServiceBus Namespace