Skip to content
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: Extend EventData with AMQP Message Details #20105

Closed
jsquire opened this issue Apr 5, 2021 · 1 comment
Closed

Event Hubs: Extend EventData with AMQP Message Details #20105

jsquire opened this issue Apr 5, 2021 · 1 comment
Assignees
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Event Hubs
Milestone

Comments

@jsquire
Copy link
Member

jsquire commented Apr 5, 2021

Summary

The EventData type currently exposes only a curated set of the information available for messages using the AMQP protocol. While this results in a simpler and more easily understood API surface for an event, it does limit interoperability with other message brokers, including Azure Service Bus.

The Service Bus message types have been enhanced to surface important protocol information, such as content type, using primary properties and to offer access to the full underlying AMQP message using the GetRawAmqpMesage method. The Event Hubs EventData type should be extended for parity with the Service Bus messages to support data flowing between Event Hubs and Service Bus as well as advanced scenarios where interoperability with other message brokers is needed.

Scope of Work

  • Extend the EventData type to make use of the Azure.Core.Amqp.AmqpAnnotatedMessage type as a backing store for the data associated with an event. Changes to the EventData should be immediately available in the underlying AmqpAnnotatedMessage and vice-versa where the AMQP data is surfaced through EventData.

  • Extend the EventData type with the following properties, considering the ServiceBusMessage as prior art:

    • ContentType (string)
    • MessageId (string)
    • CorrelationId (string)
  • Extend EventData with a method called GetRawAmqpMessage which allows access to the underlying AmqpAnnotatedMessage backing the EventData instance, following the API pattern approved for use in the ServiceBusMessage type.

  • Update the AmqpMesssageConverter to operate on the AmqpAnnotatedMessage rather than directly against the EventData instance.

  • Add a constructor overload accepting a string body type, assuming UTF-8 encoding, following the API pattern approved for use in the ServiceBusMessage type.

Out of Scope

  • Primary property support for message data unlikely to be relevant in the Event Hubs context:

    • Subject (message property)
    • To (message property)
    • ReplyTo (message property)
    • TimeToLive (message header)
    • TransactionPartitionKey (message annotation)
    • ScheduledEnqueueTime (message annotation)
    • SessionId (message property GroupId)
    • ReplyToSessionId (message property ReplyToGroupId)

Success Criteria

  • The API changes have been informally reviewed by the .NET architects and approved.

  • The EventData surface has been enhanced as detailed in the scope.

  • The AmqpMessageConverter has been updated to work against the data from AmqpAnnotatedMessage rather than an EventData instance directly.

  • Event Hubs service operations are made using the full set of data from the AmqpAnnotatedMessage.

  • The tests necessary for ensuring the feature works as intended have been created or adjusted and pass reliably.

  • Existing tests continue to produce deterministic results and pass reliably.

References and Related

@jsquire
Copy link
Member Author

jsquire commented Jun 28, 2021

Closing; the changes associated with this work have been merged.

@jsquire jsquire closed this as completed Jun 28, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Event Hubs
Projects
None yet
Development

No branches or pull requests

1 participant