New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Event Hubs] Geo DR - preview #43935
[Event Hubs] Geo DR - preview #43935
Conversation
sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.resx
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs
Show resolved
Hide resolved
public static EventPosition FromOffset(long offset, | ||
bool isInclusive = true) | ||
{ | ||
return new EventPosition | ||
{ | ||
Offset = offset.ToString(CultureInfo.InvariantCulture), | ||
SequenceNumber = offset.ToString(CultureInfo.InvariantCulture), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this implementation makes sense. I'm fine with ToString
telling them about the sequence number when they call this.
/// <param name="lastSequenceNumber">The sequence number observed the last event to be enqueued in the partition.</param> | ||
/// <param name="lastOffset">The sequence number observed the last event to be enqueued in the partition.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I changed my mind about this one from my last PR. I was thinking it just was too confusing to have the constructor just totally ignore a parameter.
I was thinking instead:
- offset -> GetSequenceNumber in EventData, (In theory - will trickle up)
- All references to the old offset properties in our internal implementation are switched to either global offset or sequence number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the typo that you fixed. I'm reasonably sure that's my bad.
This constructor is used only for testing, I believe, probably because it predates the model factory concept. I can't think of another reason why we needed a public constructor. Am I overlooking anything?
I wonder if we should just confirm that you can create from the model factory and make the new constructor internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't believe it would be used for any other reason. I will update this.
sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't have insight into the service behavior for "I used a sequence number to position a geo-dr namespace reader", I think you made the right call by not adding in the warnings when reading non-geodr checkpoints.
Co-authored-by: Jesse Squire <jesse.squire@gmail.com>
@@ -106,10 +106,10 @@ static BlobCheckpointStoreInternal() | |||
string consumerGroup, | |||
string clientIdentifier, | |||
string sequenceNumber, | |||
string replicationSegment, | |||
string globalOffset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically a breaking change and not ideal - but replication segment is just a placeholder value in the current SDK. Alternatively could just tack global offset on the end and leave replication segment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a reasonable change. The type signature is the same. It does break anyone using the name, but since the data was never actually populated, I think it's reasonable and low risk.
462e525
into
Azure:eventhubs-geodr-preview
Contributes to #39367
The concepts being updated here are the following:
The primary changes in this PR are the following:
The secondary changes are anything that is using the now-hidden properties and methods.
Included are updates to documentation and samples.