Skip to content

IEventHubDataAdapter Methods

Converts between Azure Event Hubs messages and Orleans stream cache messages.

FromQueueMessage(StreamPosition, EventData, DateTime, Func<int, ArraySegment<byte>>)

abstract
public abstract CachedMessage FromQueueMessage(StreamPosition position, EventData queueMessage, DateTime dequeueTime, Func<int, ArraySegment<byte>> getSegment)
Converts an Event Hub message into a cached message.

Parameters

positionStreamPosition
The stream position of the message.
queueMessageEventData
The Event Hub message.
dequeueTimeDateTime
The UTC time when the message was dequeued.
getSegmentFunc<int, ArraySegment<byte>>
The delegate used to allocate a cache segment of the required size.

Returns

The cached message.

GetOffset(CachedMessage)

abstract
public abstract string GetOffset(CachedMessage cachedMessage)
Gets the Event Hub offset stored in a cached message.

Parameters

cachedMessageCachedMessage
The cached message.

Returns

The Event Hub offset.

GetPartitionKey(StreamId)

abstract
public abstract string GetPartitionKey(StreamId streamId)
Gets the Event Hub partition key for a stream.

Parameters

streamIdStreamId
The stream identifier.

Returns

The partition key.

GetStreamIdentity(EventData)

abstract
public abstract StreamId GetStreamIdentity(EventData queueMessage)
Gets the Orleans stream identifier represented by an Event Hub message.

Parameters

queueMessageEventData
The Event Hub message.

Returns

The stream identifier.

GetStreamPosition(string, EventData)

abstract
public abstract StreamPosition GetStreamPosition(string partition, EventData queueMessage)
Gets the stream position represented by an Event Hub message.

Parameters

partitionstring
The Event Hub partition identifier.
queueMessageEventData
The Event Hub message.

Returns

The stream position.