public virtual StreamPosition GetStreamPosition(string partition, EventData queueMessage) { StreamId streamId = this.GetStreamIdentity(queueMessage); StreamSequenceToken token = new EventHubSequenceTokenV2(queueMessage.Offset.ToString(), queueMessage.SequenceNumber, 0); return(new StreamPosition(streamId, token)); }
public static object Deserialize(Type expected, IDeserializationContext context) { var reader = context.StreamReader; var deserialized = new EventHubSequenceTokenV2(reader.ReadString(), reader.ReadLong(), reader.ReadInt()); context.RecordObject(deserialized); return(deserialized); }
/// <summary> /// Gets the stream position from a queue message /// </summary> /// <param name="queueMessage"></param> /// <returns></returns> public virtual StreamPosition GetStreamPosition(EventData queueMessage) { Guid streamGuid = Guid.Parse(queueMessage.PartitionKey); string streamNamespace = queueMessage.GetStreamNamespaceProperty(); IStreamIdentity stremIdentity = new StreamIdentity(streamGuid, streamNamespace); StreamSequenceToken token = new EventHubSequenceTokenV2(queueMessage.Offset, queueMessage.SequenceNumber, 0); return(new StreamPosition(stremIdentity, token)); }
public static object DeepCopy(object original, ICopyContext context) { var source = original as EventHubSequenceTokenV2; if (source == null) { return(null); } var copy = new EventHubSequenceTokenV2(source.EventHubOffset, source.SequenceNumber, source.EventIndex); context.RecordCopy(original, copy); return(copy); }
/// <summary> /// Gets the stream position from a queue message /// </summary> /// <param name="queueMessage"></param> /// <returns></returns> public virtual StreamPosition GetStreamPosition(EventData queueMessage) { Guid streamGuid = #if NETSTANDARD Guid.Parse(queueMessage.SystemProperties.PartitionKey); #else Guid.Parse(queueMessage.PartitionKey); #endif string streamNamespace = queueMessage.GetStreamNamespaceProperty(); IStreamIdentity stremIdentity = new StreamIdentity(streamGuid, streamNamespace); StreamSequenceToken token = #if NETSTANDARD new EventHubSequenceTokenV2(queueMessage.SystemProperties.Offset, queueMessage.SystemProperties.SequenceNumber, 0); #else new EventHubSequenceTokenV2(queueMessage.Offset, queueMessage.SequenceNumber, 0); #endif return(new StreamPosition(stremIdentity, token)); }