-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 Client] Track Two: Third Preview (AMQP Foundation) #7431
Conversation
//cc: @chrisjbarr |
/// client types within a given scope. | ||
/// </summary> | ||
/// | ||
internal class AmqpConnectionScope : IDisposable |
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.
This type is intended to be the primary manager of connections and associated objects. There are some constructs within that aren't fully utilized yet, since we're only working against the management path. We'll continue to build on this for producer and consumer needs and I'll do a final cleanup pass for any dead items when those are complete.
|
||
var cbsLink = new AmqpCbsLink(connection); | ||
|
||
// TODO (pri2 // squire): |
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.
Thus far, this is never hit. I want to keep in in place until I finish the producer/consumer work, just in case.
@@ -16,21 +21,6 @@ internal static class AmqpError | |||
/// <summary>Indicates that a timeout occurred on the link.</summary> | |||
public static readonly AmqpSymbol TimeoutError = AmqpConstants.Vendor + ":timeout"; | |||
|
|||
/// <summary>Indicates that a message is no longer available.</summary> | |||
public static readonly AmqpSymbol MessageLockLostError = AmqpConstants.Vendor + ":message-lock-lost"; |
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.
These were all initially ported from Track One code; as I traced them, there were no references outside the mapping. They appear to be Service Bus constructs that were ported over.
@ramya-rao-a , @conniey : Any thoughts based on the error handling from your libraries would be appreciated.
{ | ||
// The request timed out. | ||
|
||
if (String.Equals(condition, TimeoutError.Value, StringComparison.InvariantCultureIgnoreCase)) |
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.
Not in love with this implementation, but I wasn't able to come up with something more elegant. I attempted to order the cases from most likely to least likely to be as efficient as possible, but want to also acknowledge that this is an error path only.
|
||
if (String.Equals(condition, AmqpErrorCode.NotFound.Value, StringComparison.InvariantCultureIgnoreCase)) | ||
{ | ||
if (NotFoundExpression.IsMatch(description) |
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 kept this logic to retain the same error behavior as track one. Upon inspection, it seemed useful to keep the distinction.
} | ||
|
||
ConnectionScope = connectionScope; | ||
ManagementLink = new FaultTolerantAmqpObject<RequestResponseAmqpLink>(timeout => ConnectionScope.OpenManagementLinkAsync(timeout, CancellationToken.None), link => link.SafeClose()); |
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 regret the lack of cancellation token here, but could not devise a means to safely and deterministically capture the token that may be in scope when this is called at arbitrary points. Given the lack of cancellation token support in the AMQP library overall, it doesn't cut against the pattern of needing to manually check too badly.
/// | ||
/// <returns>An Event Hub producer configured in the requested manner.</returns> | ||
/// | ||
public override EventHubProducer CreateProducer(EventHubProducerOptions producerOptions, |
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.
These NotImplementedExceptions
will be covered as part of the work for the AmqpEventHubProducer
and AmqpEventHubConsumer
which are forthcoming.
/// </summary> | ||
/// | ||
[Test] | ||
public void GetPartitionPropertiesAsyncCreatesTheRequest() |
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.
Due to limitations in the AMQP library, this was as deep as we could test without providing another layer of abstraction around connections; since this is already a type dedicated to AMQP, that seemed excessive. Full communication will be verified by Live test.
sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs
Show resolved
Hide resolved
19db590
to
d9af639
Compare
sdk/eventhub/Azure.Messaging.EventHubs/src/Resources.Designer.cs
Outdated
Show resolved
Hide resolved
d9af639
to
fae47f4
Compare
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Authorization/EventHubsClaim.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Compatibility/TrackOneEventHubClient.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Core/ClientLibraryInformation.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Core/ClientLibraryInformation.cs
Outdated
Show resolved
Hide resolved
fae47f4
to
451993b
Compare
sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/ConnectionTypeExtensionTests.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubClient.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.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.
LGTM. Left a few nit comments.
Amqp - Implemented the foundation for managing AMQP connections and links - Implemented the foundation for identifying and transforming AMQP errors - Enabled creation of an AMQP connection using the settings to match client options - Enabled creation of a session and link for the management path - Enhanced the message converter to handle Event Hub property request/response - Enhanced the message converter to handle partition proeprty request/response Event Hub Client - Created an Amqp transport client, with basic infrastructure - Implemented the APIs for requesting metadata from the service General - Formatting pass over the project - Fix naming for a member of hte basic retry policy for consistency
451993b
to
d4fa38c
Compare
Summary
The intent of these changes is to continue building out the AMQP foundation, focused on connections, common messages, and management operations.
Goals
EventHubClient
EventHubClient
that makes use of the track two infrastructureLast Upstream Rebase
Tuesday, September 3, 2019 8:47am (EDT)
Related and Follow-Up Issues