Class PartitionContext
Represents an Event Hub partition and its relative state, as scoped to an associated operation performed against it.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Messaging.EventHubs.dll
Syntax
public class PartitionContext
Constructors
PartitionContext(String)
Initializes a new instance of the PartitionContext class.
Declaration
[System.ComponentModel.EditorBrowsable]
protected PartitionContext (string partitionId);
Parameters
System.String
partitionId
The identifier of the Event Hub partition this context is associated with. |
Remarks
This overload should no longer be used; it does not set the members of
the context not specified.
PartitionContext(String, String, String, String)
Initializes a new instance of the PartitionContext class.
Declaration
protected internal PartitionContext (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId);
Parameters
System.String
fullyQualifiedNamespace
The fully qualified Event Hubs namespace this context is associated with. |
System.String
eventHubName
The name of the Event Hub partition this context is associated with. |
System.String
consumerGroup
The name of the consumer group this context is associated with. |
System.String
partitionId
The identifier of the Event Hub partition this context is associated with. |
Properties
ConsumerGroup
The name of the consumer group that this context is associated with.
Declaration
public string ConsumerGroup { get; }
Property Value
System.String
|
EventHubName
The name of the Event Hub that this context is associated with.
Declaration
public string EventHubName { get; }
Property Value
System.String
|
FullyQualifiedNamespace
The fully qualified Event Hubs namespace that this context is associated with.
Declaration
public string FullyQualifiedNamespace { get; }
Property Value
System.String
|
PartitionId
The identifier of the Event Hub partition this context is associated with.
Declaration
public string PartitionId { get; }
Property Value
System.String
|
Methods
ReadLastEnqueuedEventProperties()
A set of information about the last enqueued event of a partition, as observed by the associated EventHubs client associated with this context as events are received from the Event Hubs service. This is only available if the consumer was created with TrackLastEnqueuedEventProperties set.
Declaration
public virtual Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties ReadLastEnqueuedEventProperties ();
Returns
LastEnqueuedEventProperties
The set of properties for the last event that was enqueued to the partition. If no events were read or tracking was not set, the properties will be returned with default values. |
Remarks
When information about the partition's last enqueued event is being tracked, each event received from the Event Hubs
service will carry metadata about the partition that it otherwise would not. This results in a small amount of
additional network bandwidth consumption that is generally a favorable trade-off when considered
against periodically making requests for partition properties using an Event Hub client.
Exceptions
EventHubsException
Occurs when the Event Hubs client needed to read this information is no longer available. |