EventHubReceiver.Receive Method
Definition
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.
Overloads
Receive() |
Receives Event Hubs event data. |
Receive(Int32) |
Receives Event Hubs event data, up to the specified count. |
Receive(TimeSpan) |
Receives Event Hubs event data with the specified timeout value. |
Receive(Int32, TimeSpan) |
Receives Event Hubs event data, up to the specified count with the specified timeout value. |
Receive()
Receives Event Hubs event data.
public Microsoft.ServiceBus.Messaging.EventData Receive ();
member this.Receive : unit -> Microsoft.ServiceBus.Messaging.EventData
Public Function Receive () As EventData
Returns
Returns the received EventData object, or null if no event data is available.
Exceptions
Thrown if the service encounters a transient error.
Thrown if the client has a problem connecting to the service.
Thrown if the current namespace is placing too much load on the system.
Thrown if another receiver with a higher Epoch value is connected as the current receiver to the same partition specified by PartitionId.
Applies to
Receive(Int32)
Receives Event Hubs event data, up to the specified count.
public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.EventData> Receive (int maxCount);
member this.Receive : int -> seq<Microsoft.ServiceBus.Messaging.EventData>
Public Function Receive (maxCount As Integer) As IEnumerable(Of EventData)
Parameters
- maxCount
- Int32
The maximum amount of event data the user is willing to accept in one call.
Returns
Returns the received
EventData collection. The collection is either empty if no event is returned within the specified time, or all events up to maxCount
are returned.
Exceptions
Thrown if the service encounters a transient error.
Thrown if the client has a problem connecting to the service.
Thrown if the current namespace is placing too much load on the system.
Thrown if another receiver with a higher Epoch value is connected as the current receiver to the same partition specified by PartitionId.
Remarks
Service does not wait for maxCount
events to be filled before returning to user. It returns as soon as there are any events available.
Applies to
Receive(TimeSpan)
Receives Event Hubs event data with the specified timeout value.
public Microsoft.ServiceBus.Messaging.EventData Receive (TimeSpan waitTime);
member this.Receive : TimeSpan -> Microsoft.ServiceBus.Messaging.EventData
Public Function Receive (waitTime As TimeSpan) As EventData
Parameters
- waitTime
- TimeSpan
The maximum time the user is willing to wait for event data to arrive.
Returns
Returns the received EventData collection, or null if there is no event data available.
Exceptions
Thrown if the service encounters a transient error.
Thrown if the client has a problem connecting to the service.
Thrown if the current namespace is placing too much load on the system.
Thrown if another receiver with a higher Epoch value is connected as the current receiver to the same partition specified by PartitionId.
Remarks
waitTime
is not a guaranteed wait time, as API will return data as soon as it is available.
Applies to
Receive(Int32, TimeSpan)
Receives Event Hubs event data, up to the specified count with the specified timeout value.
public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.EventData> Receive (int maxCount, TimeSpan waitTime);
member this.Receive : int * TimeSpan -> seq<Microsoft.ServiceBus.Messaging.EventData>
Public Function Receive (maxCount As Integer, waitTime As TimeSpan) As IEnumerable(Of EventData)
Parameters
- maxCount
- Int32
The maximum amount of event data the user is willing to accept in one call.
- waitTime
- TimeSpan
The maximum time the user is willing to wait for event data to arrive.
Returns
Returns the received
EventData collection. The collection is either empty if no event is returned within the specified time, or all events up to maxCount
are returned.
Exceptions
Thrown if the service encounters a transient error.
Thrown if the client has a problem connecting to the service.
Thrown if the current namespace is placing too much load on the system.
Thrown if another receiver with a higher Epoch value is connected as the current receiver to the same partition specified by PartitionId.
Remarks
waitTime
is not a guaranteed wait time, as API will return data as soon as it is available. Also service does not wait for maxCount
events to be filled before returning to user. it returns as soon as there are any events available.
Applies to
Azure SDK for .NET