Skip to content

EventHubBatchContainer Methods

Batch container that is delivers payload and stream position information for a set of events in an EventHub EventData.

GetEvents

View source
public IEnumerable<Tuple<T, StreamSequenceToken>> GetEvents<T>()
Gets events of a specific type from the batch.

ImportRequestContext

View source
public bool ImportRequestContext()
Gives an opportunity to IBatchContainer to set any data in the RequestContext before this IBatchContainer is sent to consumers. It can be the data that was set at the time event was generated and enqueued into the persistent provider or any other data.

Returns

True if the RequestContext was indeed modified, false otherwise.

UpdateEventData(EventData, Serializer, StreamId, IEnumerable<T>, Dictionary<string, object>)

static
View source
public static void UpdateEventData<T>(EventData eventData, Serializer bodySerializer, StreamId streamId, IEnumerable<T> events, Dictionary<string, object> requestContext)
Updates the event data with the events list and its context.

Parameters

eventDataEventData
The Azure.Messaging.EventHubs.EventData instance to update with a new body and context.
bodySerializerSerializer
The serializer to use for creating the event body payload.
streamIdStreamId
The stream identifier to associate with the event context.
eventsIEnumerable<T>
The events list to use for the payload.
requestContextDictionary<string, object>
The request context to associate with the event.