SALES: 1-800-867-1380

MessageSession.OnTryReceive Method (TrackingContext, Int32, TimeSpan, IEnumerable(Of BrokeredMessage))

Attempts a message receive operation.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

Protected Overrides Function OnTryReceive ( _
	trackingContext As TrackingContext, _
	messageCount As Integer, _
	serverWaitTime As TimeSpan, _
	<OutAttribute> ByRef messages As IEnumerable(Of BrokeredMessage) _
) As Boolean
Dim trackingContext As TrackingContext
Dim messageCount As Integer
Dim serverWaitTime As TimeSpan
Dim messages As IEnumerable(Of BrokeredMessage)
Dim returnValue As Boolean

returnValue = Me.OnTryReceive(trackingContext, _
	messageCount, serverWaitTime, messages)


Type: Microsoft.ServiceBus.Tracing.TrackingContext
The context information associated by a transaction tracking this operation.
Type: System.Int32
The number of messages to try to receive.
Type: System.TimeSpan
The time span interval the operation waits before it times out.
Type: System.Collections.Generic.IEnumerable(Of BrokeredMessage)
A collection of BrokeredMessage objects.

Return Value

Type: System.Boolean
true if the receive operation was successful; otherwise, false.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft