question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sample: Working with Cloud Events

See original GitHub issue

Summary

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 with CloudEvent and Event Hubs should be written, covering:

    • Translating between CloudEvent and EventData, including where commonly used data/attributes map between them
    • Using CloudEvent with the EventHubProducerClient and EventHubBufferedProducerClient for publishing data
    • Using CloudEvent with the EventHubConsumerClient and EventProcessorClient for consuming data
  • A sample for Azure.Messaging.EventHubs.Processor focused on interacting with CloudEvent and Event Hubs should be written, covering:

    • Using CloudEvent with EventProcessorClient for consuming data

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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jsquirecommented, Jun 2, 2022

I don’t see any overloads that accepts CloudEvent for publishing events. Does this mean we have to create a sample CloudEvent json, convert/map it to EventData then publish the event? Similarly, for Consumer we read EventData and convert/map it to CloudEvent?

Yes. I’d start with Azure.Messaging.CloudEvent from Azure.Core - whether you pull that in from JSON or create it directly - and map that to/from EventData.

0reactions
jsquirecommented, Jul 21, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CloudEvents v1.0 schema with Azure Event Grid
Sample event using CloudEvents schema​​ A detailed description of the available fields, their types, and definitions in CloudEvents v1. 0 is ...
Read more >
Use Azure Event Grid with events in CloudEvents schema
CloudEvents simplifies interoperability by providing a common event schema for publishing and consuming cloud-based events. This schema allows ...
Read more >
CloudEvents - JSON event format | Eventarc
Eventarc delivers events to the event receiver in the CloudEvents format through an HTTP request. The destination target—for example, the ...
Read more >
Using CloudEvents and CloudEvents Generator
This document discusses CloudEvents and the usage of CloudEvents Generator, which helps you better understand the demo projects used in other tutorials of ......
Read more >
CloudEvents |
CloudEvents is a specification for describing event data in a common way. CloudEvents seeks to dramatically simplify event declaration and delivery across ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found