Skip to content

Issue with cadinality many and dataType binary on eventHubTrigger Azure function in nodejs #1376

@Kiupi

Description

@Kiupi

Hello,

I currently facing an issue on node azure function using eventHubTrigger with cardinality set to many and dataType to binary.
Here is my function.json file :

{
"bindings": [
    {
      "type": "eventHubTrigger",
      "name": "eventHubMessages",
      "direction": "in",
      "eventHubName": _"topic-name",_
      "connection": "EventHubConnexion",
      "cardinality": "many",
      "consumerGroup": "$Default",
      "dataType": "binary"
    }
  ],
  "scriptFile": "../dist/EventHubTrigger/index.js"
}

In fact, I set up a MirrorMaker which send datas from a kafka bus on a personal eventHub. Kafka datas are avro datas with single object encoding sent as binary buffer.

When my azure function trigger on my eventHub, I get the datas on an array but it's an array of strings and not bytes while datatype is set to binary. Moreover, when i set cardinality to one and not many, datas have good format but I don't want to use this cardinality because it is bad for performances.

I need to get this frames as bytes buffer with cardinality to many because i need to decode frames for extract all usefulls datas.

To prevent this issue I also tried to convert frames stringified thank to the Buffer.from method but it seems string convertion is wrong because when I try to decode, then i have an error while it's work with the buffer given when I set cardinality to one.

Is it a known issue, specific to nodejs, or an abnormal behavior ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions