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

Properties and System properties missing when subscribing to Azure Events pubsub #2530

Open
ralarcon opened this issue Feb 14, 2023 · 4 comments
Labels
help wanted Extra attention is needed P1 size/XS 2 days of work triaged/resolved
Milestone

Comments

@ralarcon
Copy link

ralarcon commented Feb 14, 2023

Expected Behavior

Using the PubSub or Input binding with Azure Event Hubs, I get all the relevant information: event body, properties and system properties.

Actual Behavior

The binding is missing important events data that are stored in properties and system properties. Other services send events to Event Hubs and use that properties and system properties to provide relevant information, for example, IoT Hub, where fixes to the binding has been done to include that important information:

There has been other issues related to this which have fixed the integration with Azure IoT Hubs and its compatible Event Hub endpoint:

#1151
#1243

In the case of Azure Digital Twins (ADT), when you route output data to Event Hubs, the following information is part of the event:
Payload / Event Body:

{
    "modelId": "dtmi:contosocom:DigitalTwins:Thermostat;1",
    "patch": [
        {
            "value": 68.96053795403296,
            "path": "/Temperature",
            "op": "replace"
        }
    ]
}

Properties:

    "cloudEvents:id": "4b5798eb-bbfc-47c9-b51d-7caa1d21c1c1",
    "cloudEvents:source": "dt-101.api.weu.digitaltwins.azure.net",
    "cloudEvents:specversion": "1.0",
    "cloudEvents:type": "Microsoft.DigitalTwins.Twin.Update",
    "cloudEvents:time": "2023-02-10T07:11:37.2157194Z",
    "cloudEvents:subject": "thermostat1",
    "cloudEvents:traceparent": "00-f6adffd202e09341d346d52e9ff7d6ce-cf6d7f32fe23bb9e-01",
    "CorrelationId": "8038e0bb-15e6-4470-9d50-bc7bf6888080",
    "ContentType": "application/json"

System Properties:

    "x-opt-sequence-number": 2874,
    "x-opt-offset": 1838336,
    "x-opt-enqueued-time": "2023-02-10T07:11:37.923+00:00"

Here you can see the whole event data from a C# debug screenshot:
image

Steps to Reproduce the Problem

Use PubSub / Input Binding components with Azure Event Hubs + ADT output as described in this article: https://learn.microsoft.com/en-us/azure/digital-twins/concepts-route-events

Create a client application that use the DAPR eventhubs pub/sub (go or C#) and the properties and system properties are not present when receiving the data.

In the code there are some references to the "requireAllProperties" but not found a way to make it work:

getAllProperties := utils.IsTruthy(req.Metadata["requireAllProperties"])

Another way to test it is to create a client app that uses the PubSub with EventHubs, publis some events adding properties and validate that the properties or system properties are not present when subscribed to EventsHub.

@ralarcon ralarcon added the kind/bug Something isn't working label Feb 14, 2023
@berndverst berndverst added help wanted Extra attention is needed P2 size/XS 2 days of work triaged/resolved and removed kind/bug Something isn't working labels Feb 14, 2023
@berndverst berndverst added this to the v1.11 milestone Feb 14, 2023
@berndverst
Copy link
Member

@ItalyPaleAle do you remember whether the IOT Hub properties are now being sent correctly after you switched the EventHubs implementation?

@berndverst berndverst added P1 and removed P2 labels Feb 14, 2023
@berndverst berndverst modified the milestones: v1.11, v1.12 May 31, 2023
@artursouza artursouza modified the milestones: v1.12, v1.13 Oct 5, 2023
@grzegorzmusial-grundfos

Pub/sub components was the only reason I started looking into DAPR few days ago.
But this issue is blocking me for using it at all.

I'm using data enrichment in IotHub on custom endpoints. When using DAPR with Eventhub pub/sub, all custom message properties are skipped.

I found this piece of code, which is responsible for passing through properties from incoming EventHub message:
https://github.com/dapr/components-contrib/blob/main/common/component/azure/eventhubs/events.go

Only short list of properties are supported, all others go to default "// nop" statement.

I can't figure out what could be the reason for not including them all?
Or maybe metadata "requireAllProperties" should be renamed to "requireAlmostAllProperties" ;)

@ItalyPaleAle ItalyPaleAle modified the milestones: v1.13, v1.14 Feb 26, 2024
@AiHaibara
Copy link

hope to using dapr for scale out instance process eventhub message, cause direct using eventhub sdk seems will limit by partition count. (using dapr can helpful for this correct?)

will the all properties will support?

@AiHaibara
Copy link

hope to using dapr for scale out instance process eventhub message, cause direct using eventhub sdk seems will limit by partition count. (using dapr can helpful for this correct?)

it seems it will also limit by partition count, only one app will receive the request if partition count is 1.

@berndverst berndverst modified the milestones: v1.14, v1.15 Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed P1 size/XS 2 days of work triaged/resolved
Projects
None yet
Development

No branches or pull requests

6 participants