EventHubConsumerGroup.CreateReceiverAsync 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
CreateReceiverAsync(String, String, Boolean, Int64, ReceiverOptions)
Asynchronous version of CreateReceiver(String, String, Boolean, Int64, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, string startingOffset, bool offsetInclusive, long epoch, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * string * bool * int64 * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingOffset As String, offsetInclusive As Boolean, epoch As Long, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingOffset
- String
The starting offset at which to start receiving messages.
- offsetInclusive
- Boolean
A Boolean value that indicates whether startingOffset
is treated as an inclusive offset, meaning that the first
event returned is the event that contains the starting offset. Normally, the first event returned is the event after the starting offset.
- epoch
- Int64
The epoch value. The service uses this value to enforce partition/lease ownership.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Applies to
CreateReceiverAsync(String, String, Int64, ReceiverOptions)
Asynchronous version of CreateReceiver(String, String, Int64, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, string startingOffset, long epoch, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * string * int64 * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingOffset As String, epoch As Long, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingOffset
- String
The starting offset at which to start receiving messages. To specify the start of the stream, see StartOfStream.
- epoch
- Int64
The epoch value. The service uses this value to enforce partition/lease ownership.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Applies to
CreateReceiverAsync(String, String, Boolean, ReceiverOptions)
Asynchronous version of CreateReceiver(String, String, Boolean, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, string startingOffset, bool offsetInclusive, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * string * bool * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingOffset As String, offsetInclusive As Boolean, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingOffset
- String
The starting offset at which to start receiving messages.
- offsetInclusive
- Boolean
A Boolean value that indicates whether startingOffset
is treated as an inclusive offset, meaning that the first
event returned is the event that contains the starting offset. Normally, the first event returned is the event after the starting offset.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Applies to
CreateReceiverAsync(String, DateTime, Int64, ReceiverOptions)
Asynchronous version of CreateReceiver(String, DateTime, Int64, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, DateTime startingDateTimeUtc, long epoch, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * DateTime * int64 * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingDateTimeUtc As DateTime, epoch As Long, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingDateTimeUtc
- DateTime
The starting UTC time for receiving messages.
- epoch
- Int64
The epoch value. The service uses this value to enforce partition/lease ownership.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Remarks
Service only uses this startingDateTimeUtc
as an approximation when determining next event to deliver.
Keep in mind that there can be clock skew between client time and service time, so user application should be designed to handle duplication in event delivery.
Applies to
CreateReceiverAsync(String, DateTime, ReceiverOptions)
Asynchronous version of CreateReceiver(String, DateTime, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, DateTime startingDateTimeUtc, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * DateTime * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingDateTimeUtc As DateTime, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingDateTimeUtc
- DateTime
The starting UTC time for receiving messages.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Remarks
Service only use this startingDateTimeUtc
as an approximation when determining next event to deliver.
Keep in mind that there can be clock skew between client time and service time, so user application should be designed to handle duplication in event delivery.
Applies to
CreateReceiverAsync(String, String, ReceiverOptions)
Asynchronous version of CreateReceiver(String, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, string startingOffset, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * string * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, startingOffset As String, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- startingOffset
- String
The starting offset at which to start receiving messages.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Applies to
CreateReceiverAsync(String, Int64, ReceiverOptions)
Asynchronous version of CreateReceiver(String, Int64, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, long epoch, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * int64 * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, epoch As Long, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- epoch
- Int64
The epoch value. The service uses this value to enforce partition/lease ownership.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Remarks
If the EventHubConsumerGroup has checkpoint enabled, then the receiver will get next message from the checkpoint offset. If checkpoint is disabled, then receiver will get message from the start of the event stream, as determined by the message retention policy of the Event Hub.
Applies to
CreateReceiverAsync(String, ReceiverOptions)
Asynchronous version of CreateReceiver(String, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Remarks
If the EventHubConsumerGroup has checkpoint enabled, this overload will always throw InvalidOperationException because checkpoint enabled ConsumerGroup requires epoch to work (please use the overload that supply epoch as input argument). If checkpoint is disabled, then receiver will get message from the start of the event stream, as determined by the message retention policy of the Event Hub.
Applies to
CreateReceiverAsync(String, EventPosition, Nullable<Int64>, ReceiverOptions)
Asynchronous version of CreateReceiver(String, EventPosition, Nullable<Int64>, ReceiverOptions).
public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver> CreateReceiverAsync (string partitionId, Microsoft.ServiceBus.Messaging.EventPosition position, long? epoch = default, Microsoft.ServiceBus.Messaging.ReceiverOptions receiverOptions = default);
member this.CreateReceiverAsync : string * Microsoft.ServiceBus.Messaging.EventPosition * Nullable<int64> * Microsoft.ServiceBus.Messaging.ReceiverOptions -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventHubReceiver>
Public Function CreateReceiverAsync (partitionId As String, position As EventPosition, Optional epoch As Nullable(Of Long) = Nothing, Optional receiverOptions As ReceiverOptions = Nothing) As Task(Of EventHubReceiver)
Parameters
- partitionId
- String
The ID of the partition.
- position
- EventPosition
The starting EventPosition at which to start receiving messages.
The epoch value. The service uses this value to enforce partition/lease ownership.
- receiverOptions
- ReceiverOptions
Options for a event hub receiver.
Returns
Returns Task<TResult>.
Applies to
Azure SDK for .NET