Event Hubs: Extend EventData
with AMQP Message Details
#20105
Labels
blocking-release
Blocks release
Client
This issue points to a problem in the data-plane of the library.
Event Hubs
Milestone
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 HubsEventData
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 theAzure.Core.Amqp.AmqpAnnotatedMessage
type as a backing store for the data associated with an event. Changes to theEventData
should be immediately available in the underlyingAmqpAnnotatedMessage
and vice-versa where the AMQP data is surfaced throughEventData
.Extend the
EventData
type with the following properties, considering theServiceBusMessage
as prior art:ContentType
(string)MessageId
(string)CorrelationId
(string)Extend
EventData
with a method calledGetRawAmqpMessage
which allows access to the underlyingAmqpAnnotatedMessage
backing theEventData
instance, following the API pattern approved for use in theServiceBusMessage
type.Update the
AmqpMesssageConverter
to operate on theAmqpAnnotatedMessage
rather than directly against theEventData
instance.Add a constructor overload accepting a
string
body type, assuming UTF-8 encoding, following the API pattern approved for use in theServiceBusMessage
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 propertyGroupId
)ReplyToSessionId
(message propertyReplyToGroupId
)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 fromAmqpAnnotatedMessage
rather than anEventData
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
ServiceBusMessage
AmqpMessageConverter
Azure.Core.Amqp
The text was updated successfully, but these errors were encountered: