dapr / dapr/dotnet-sdk

Dapr integration with Azure Event Hub with CloudEvent

Open
#1,131 2 comments 0 reactions 0 assignees View on GitHub
area/client/pubsub question
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

Hi Team,

I'm trying to demo a data ingestion system using Dapr Pub/Sub component integrated with Azure Event Hub. So then I can use Event Hub Stream Analytics Job to forward the message to Comosdb.

1. Dapr "orderproducer" generates fake order and push to Azure Event Hub.
2. Event Hub forward the message to Cosmosdb.

Dapr is not generating the CloudEvent payload with the correct id (event id). It always comes with "orderproducer" (app-name). I tried to customise following this: https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-cloudevents/, but no success.

Dapr Componet configuration:
![image](https://github.com/dapr/dotnet-sdk/assets/6051863/ea82b4a5-0aa8-4495-972a-1663f5070d38)

Dotnet code using BulkPublishEventAsync into Event Hub. I've tried PublishEventAsync, but I got the same problem.
![image](https://github.com/dapr/dotnet-sdk/assets/6051863/e8f68978-8ce6-4513-a7c8-7db39d4a06d9)

What I got in cosmosdb:
![image](https://github.com/dapr/dotnet-sdk/assets/6051863/2b85084d-6725-481c-be93-ec5132a9d630)

I tried this as well:
![image](https://github.com/dapr/dotnet-sdk/assets/6051863/9461ea61-4fc3-4c34-92b0-e02cd90bb82b)

I was expecting the following content values:
* "id" with a unique identifier
* "source" with the value "OrderProducer"
* "type" with the value "OrderCreatedOrUpdatedEventV1"

Thanks,
Gio

Contributor guide

Open the contributing guide

Research direction

Start with the linked CloudEvents documentation, then inspect the shown Dapr component configuration and the .NET calls using BulkPublishEventAsync and PublishEventAsync. Compare their emitted payload with the Cosmos DB example and determine whether the integration can produce the expected unique id, OrderProducer source, and event type; done means the resulting CloudEvent fields match those expectations.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.