Share via


QueueClient.RetrieveMultiple Method (Int32, TimeSpan)

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

Retrieves up to the specified number of events from the queue.

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

Usage

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

returnValue = instance.RetrieveMultiple(maxMessages, timeout)

Syntax

'Declaration
Public Function RetrieveMultiple ( _
    maxMessages As Integer, _
    timeout As TimeSpan _
) As IEnumerable(Of Message)
public IEnumerable<Message> RetrieveMultiple (
    int maxMessages,
    TimeSpan timeout
)
public:
IEnumerable<Message^>^ RetrieveMultiple (
    int maxMessages, 
    TimeSpan timeout
)
public IEnumerable<Message> RetrieveMultiple (
    int maxMessages, 
    TimeSpan timeout
)
public function RetrieveMultiple (
    maxMessages : int, 
    timeout : TimeSpan
) : 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.
  • timeout
    The period, in seconds, that the client wants to allow the call to block until a message is retrieved.

Return Value

Returns a IEnumerable that contains the messages.

Exceptions

Exception type Condition
TimeoutException

The timeout has expired.

Remarks

The method blocks until at least one message can be retrieved from the queue or until the given timeout expires.

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