Sample: Working with Cloud Events
See original GitHub issueSummary
With CloudEvent
being added as a common abstraction in Azure.Core
, it provides a neutral type for working with event data across the Azure messaging services. It would be helpful to have a set of samples fore core Event Hubs scenarios that demonstrate translating between CloudEvent
and EventData
.
Scope of Work
-
A sample for
Azure.Messaging.EventHubs
focused on interacting withCloudEvent
and Event Hubs should be written, covering:- Translating between
CloudEvent
andEventData
, including where commonly used data/attributes map between them - Using
CloudEvent
with theEventHubProducerClient
andEventHubBufferedProducerClient
for publishing data - Using
CloudEvent
with theEventHubConsumerClient
andEventProcessorClient
for consuming data
- Translating between
-
A sample for
Azure.Messaging.EventHubs.Processor
focused on interacting withCloudEvent
and Event Hubs should be written, covering:- Using
CloudEvent
withEventProcessorClient
for consuming data
- Using
Out of Scope
-
Demonstrating interactions between Event Hubs and other messaging libraries using
CloudEvent
as an intermediate format; this would cross library boundaries and should be considered as a stand-alone sample in the common samples area of the repository. -
Demonstrating use in an Azure Functions context; that should be considered as a stand-alone effort for the extensions package.
Success Criteria
-
The topics detailed by the scope have been documented in the samples.
-
All code in the samples are snippet-driven, with the code being built and smoke tested as part of nightly runs.
-
The existing samples have been reviewed for accuracy and are in a good state for release of the Event Hubs client libraries.
-
The tests necessary for sample validation have been created or adjusted and pass reliably.
-
The existing test suite continues to produce deterministic results and pass reliably.
References and Resources
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Yes. I’d start with
Azure.Messaging.CloudEvent
fromAzure.Core
- whether you pull that in from JSON or create it directly - and map that to/fromEventData
.Revisiting - this is not a scenario for which we’ve received much customer interest and doesn’t fit the current direction of the Event Hubs product. Closing this out.