Show / Hide Table of Contents

Class EventHubsModelFactory

A factory for the creation of Event Hubs model types to assist with mocking and testing.

Inheritance
System.Object
EventHubsModelFactory
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Messaging.EventHubs.dll
Syntax
public static class EventHubsModelFactory

Methods

EventData(BinaryData, IDictionary<String,Object>, IReadOnlyDictionary<String,Object>, String, Int64, Int64, DateTimeOffset)

Obsolete.

Initializes a new instance of the EventData class.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Please use the overload with a string-based offset instead.", false)]
public static Azure.Messaging.EventHubs.EventData EventData (BinaryData eventBody, System.Collections.Generic.IDictionary<string,object> properties = null, System.Collections.Generic.IReadOnlyDictionary<string,object> systemProperties = null, string partitionKey = null, long sequenceNumber = -9223372036854775808, long offset = -9223372036854775808, DateTimeOffset enqueuedTime = null);
Parameters
System.BinaryData eventBody

The data to use as the body of the event.

System.Collections.Generic.IDictionary<System.String,System.Object> properties

The set of free-form event properties to send with the event.

System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object> systemProperties

The set of system properties that accompany events read from the Event Hubs service.

System.String partitionKey

The partition hashing key associated with the event when it was published.

System.Int64 sequenceNumber

The sequence number assigned to the event when it was enqueued in the associated Event Hub partition.

System.Int64 offset

The offset of the event when it was received from the associated Event Hub partition.

System.DateTimeOffset enqueuedTime

The date and time, in UTC, of when the event was enqueued in the Event Hub partition.

Returns
EventData

Remarks

This method is obsolete and should no longer be used. Please use the overload with a string-based offset instead.

EventData(BinaryData, IDictionary<String,Object>, IReadOnlyDictionary<String,Object>, String, Int64, String, DateTimeOffset)

Initializes a new instance of the EventData class.

Declaration
public static Azure.Messaging.EventHubs.EventData EventData (BinaryData eventBody, System.Collections.Generic.IDictionary<string,object> properties = null, System.Collections.Generic.IReadOnlyDictionary<string,object> systemProperties = null, string partitionKey = null, long sequenceNumber = -9223372036854775808, string offsetString = null, DateTimeOffset enqueuedTime = null);
Parameters
System.BinaryData eventBody

The data to use as the body of the event.

System.Collections.Generic.IDictionary<System.String,System.Object> properties

The set of free-form event properties to send with the event.

System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object> systemProperties

The set of system properties that accompany events read from the Event Hubs service.

System.String partitionKey

The partition hashing key associated with the event when it was published.

System.Int64 sequenceNumber

The sequence number assigned to the event when it was enqueued in the associated Event Hub partition.

System.String offsetString

The offset of the event when it was received from the associated Event Hub partition.

System.DateTimeOffset enqueuedTime

The date and time, in UTC, of when the event was enqueued in the Event Hub partition.

Returns
EventData

EventDataBatch(Int64, IList<EventData>, CreateBatchOptions, Func<EventData,Boolean>)

Initializes a new instance of the EventDataBatch(Int64, IList<EventData>, CreateBatchOptions, Func<EventData,Boolean>) class.

Declaration
public static Azure.Messaging.EventHubs.Producer.EventDataBatch EventDataBatch (long batchSizeBytes, System.Collections.Generic.IList<Azure.Messaging.EventHubs.EventData> batchEventStore, Azure.Messaging.EventHubs.Producer.CreateBatchOptions batchOptions = null, Func<Azure.Messaging.EventHubs.EventData,bool> tryAddCallback = null);
Parameters
System.Int64 batchSizeBytes

The size, in bytes, that the batch should report; this is a static value and will not mutate as events are added.

System.Collections.Generic.IList<EventData> batchEventStore

A list to which events will be added when TryAdd(EventData) calls are successful.

CreateBatchOptions batchOptions

The set of options to consider when creating this batch.

System.Func<EventData,System.Boolean> tryAddCallback

A function that will be invoked when TryAdd(EventData) is called; the return of this callback represents the result of TryAdd(EventData). If not provided, all events will be accepted into the batch.

Returns
EventDataBatch

The EventDataBatch(Int64, IList<EventData>, CreateBatchOptions, Func<EventData,Boolean>) instance that was created.

Remarks

It is important to note that the batch will keep an internal copy of events accepted by TryAdd(EventData); changes made to batchEventStore outside of the batch will not be reflected by the batch.

EventHubProperties(String, DateTimeOffset, String[])

Initializes a new instance of the EventHubProperties class.

Declaration
[System.ComponentModel.EditorBrowsable]
public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties (string name, DateTimeOffset createdOn, string[] partitionIds);
Parameters
System.String name

The name of the Event Hub.

System.DateTimeOffset createdOn

The date and time at which the Event Hub was created.

System.String[] partitionIds

The set of unique identifiers for each partition.

Returns
EventHubProperties

EventHubProperties(String, DateTimeOffset, String[], Boolean)

Initializes a new instance of the EventHubProperties class.

Declaration
[System.ComponentModel.EditorBrowsable]
public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties (string name, DateTimeOffset createdOn, string[] partitionIds, bool isGeoReplicationEnabled);
Parameters
System.String name

The name of the Event Hub.

System.DateTimeOffset createdOn

The date and time at which the Event Hub was created.

System.String[] partitionIds

The set of unique identifiers for each partition.

System.Boolean isGeoReplicationEnabled

A flag indicating whether or not the Event Hubs namespace has geo-replication enabled.

Returns
EventHubProperties

LastEnqueuedEventProperties(Nullable<Int64>, Nullable<Int64>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Initializes a new instance of the LastEnqueuedEventProperties class.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Please use the overload with a string-based offset instead.", false)]
public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties (Nullable<long> lastSequenceNumber, Nullable<long> lastOffset, Nullable<DateTimeOffset> lastEnqueuedTime, Nullable<DateTimeOffset> lastReceivedTime);
Parameters
System.Nullable<System.Int64> lastSequenceNumber

The sequence number observed the last event to be enqueued in the partition.

System.Nullable<System.Int64> lastOffset

The offset of the last event to be enqueued in the partition.

System.Nullable<System.DateTimeOffset> lastEnqueuedTime

The date and time, in UTC, that the last event was enqueued in the partition.

System.Nullable<System.DateTimeOffset> lastReceivedTime

The date and time, in UTC, that the information was last received.

Returns
LastEnqueuedEventProperties

LastEnqueuedEventProperties(Nullable<Int64>, String, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Initializes a new instance of the LastEnqueuedEventProperties class.

Declaration
public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties (Nullable<long> lastSequenceNumber, string lastOffsetString, Nullable<DateTimeOffset> lastEnqueuedTime, Nullable<DateTimeOffset> lastReceivedTime);
Parameters
System.Nullable<System.Int64> lastSequenceNumber

The sequence number observed the last event to be enqueued in the partition.

System.String lastOffsetString

The offset of the last event to be enqueued in the partition.

System.Nullable<System.DateTimeOffset> lastEnqueuedTime

The date and time, in UTC, that the last event was enqueued in the partition.

System.Nullable<System.DateTimeOffset> lastReceivedTime

The date and time, in UTC, that the information was last received.

Returns
LastEnqueuedEventProperties

PartitionContext(String, LastEnqueuedEventProperties)

Initializes a new instance of the PartitionContext class.

Declaration
[System.ComponentModel.EditorBrowsable]
public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext (string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = null);
Parameters
System.String partitionId

The identifier of the Event Hub partition this context is associated with.

LastEnqueuedEventProperties lastEnqueuedEventProperties

The set of properties to be returned when ReadLastEnqueuedEventProperties() is invoked.

Returns
PartitionContext

PartitionContext(String, String, String, String, LastEnqueuedEventProperties)

Initializes a new instance of the PartitionContext class.

Declaration
public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = null);
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.

LastEnqueuedEventProperties lastEnqueuedEventProperties

The set of properties to be returned when ReadLastEnqueuedEventProperties() is invoked.

Returns
PartitionContext

PartitionProperties(String, String, Boolean, Int64, Int64, Int64, DateTimeOffset)

Obsolete.

Initializes a new instance of the PartitionProperties class.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Please use the overload with a string-based offset instead.", false)]
public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties (string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, DateTimeOffset lastEnqueuedTime);
Parameters
System.String eventHubName

The name of the Event Hub that contains the partitions.

System.String partitionId

The identifier of the partition.

System.Boolean isEmpty

Indicates whether or not the partition is currently empty.

System.Int64 beginningSequenceNumber

The first sequence number available for events in the partition.

System.Int64 lastSequenceNumber

The sequence number observed the last event to be enqueued in the partition.

System.Int64 lastOffset

The offset of the last event to be enqueued in the partition.

System.DateTimeOffset lastEnqueuedTime

The date and time, in UTC, that the last event was enqueued in the partition.

Returns
PartitionProperties

Remarks

This method is obsolete and should no longer be used. Please use the overload with a string-based offset instead.

PartitionProperties(String, String, Boolean, Int64, Int64, String, DateTimeOffset)

Initializes a new instance of the PartitionProperties class.

Declaration
public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties (string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, string lastOffsetString, DateTimeOffset lastEnqueuedTime);
Parameters
System.String eventHubName

The name of the Event Hub that contains the partitions.

System.String partitionId

The identifier of the partition.

System.Boolean isEmpty

Indicates whether or not the partition is currently empty.

System.Int64 beginningSequenceNumber

The first sequence number available for events in the partition.

System.Int64 lastSequenceNumber

The sequence number observed the last event to be enqueued in the partition.

System.String lastOffsetString

The offset of the last event to be enqueued in the partition.

System.DateTimeOffset lastEnqueuedTime

The date and time, in UTC, that the last event was enqueued in the partition.

Returns
PartitionProperties

PartitionPublishingProperties(Boolean, Nullable<Int64>, Nullable<Int16>, Nullable<Int32>)

Initializes a new instance of the PartitionPublishingProperties class.

Declaration
[System.ComponentModel.EditorBrowsable]
public static Azure.Messaging.EventHubs.Producer.PartitionPublishingProperties PartitionPublishingProperties (bool isIdempotentPublishingEnabled, Nullable<long> producerGroupId, Nullable<short> ownerLevel, Nullable<int> lastPublishedSequenceNumber);
Parameters
System.Boolean isIdempotentPublishingEnabled

Indicates whether idempotent publishing is enabled.

System.Nullable<System.Int64> producerGroupId

The identifier of the producer group associated with the partition.

System.Nullable<System.Int16> ownerLevel

The owner level associated with the partition.

System.Nullable<System.Int32> lastPublishedSequenceNumber

The sequence number assigned to the event that was last successfully published to the partition.

Returns
PartitionPublishingProperties

Back to top Azure SDK for .NET