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.

Linux nodejs function with multiple eventhub output bindings not sending data

See original GitHub issue

Short intro: HTTP Trigger which is calling the function, then take a message and put that via output binding to 4 other eventhubs

  • Timestamp: 2021-02-17T09:53:41.423
  • Function App version: 3
  • Function App name: [company data, try to deliver everything else]
  • Function name(s) (as appropriate): Functions.HttpTrigger1
  • Host InstanceId ID: f00d3e73-aec3-4f1d-9931-fbd2e8c0e309
  • Executing ‘Functions.HttpTrigger1’ ID: 2b28d94b-82d6-4ba0-8069-4d4d5d065c02
  • Region: westeu [cannot see the function started id in the logs]

Repro steps

Provide the steps required to reproduce the problem:

  • create four eventhubs
  • create a function app in an appserviceplan
  • create a http trigger function with four output bindings to the corresponding eventhubs
  • call that function

Expected behavior

Would have expected the message to be delivered to all four eventhubs

Actual behavior

Nothing happens, just trigger no error no issue.

Known workarounds

none

BUT if you comment out three of the four output bindings then the left one ist working. You can do this for every output, so the connection strings are not the problem. AND the same can be reproduced with python…

Related information

Stack NodeJS NodeJs 12 LTS Authorization anonymous

Appsettings the Connectiong strings to the hubs

Source

module.exports = async function (context, req) {

    const name = (req.query.name || (req.body && req.body.name));
    const responseMessage = name
        ? "Hello, " + name + ". This HTTP triggered function executed successfully."
        : "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.";

    let tempBufferDEV = [{'fruit':'Apple'}, {'fruit':name}];
    let tempBufferTEST = [{'fruit':'Apple'}, {'fruit':name}];
    let tempBufferSTAGE = [{'fruit':'Apple'}, {'fruit':name}];
    let tempBufferPROD = [{'fruit':'Apple'}, {'fruit':name}];

    // test
    context.bindings.outputEventHubIoTDataMessagesTest = tempBufferTEST;
    
    // dev
    context.bindings.outputEventHubIoTDataMessagesDev = tempBufferDEV;
    
    // stage
    context.bindings.outputEventHubIoTDataMessagesStage = tempBufferSTAGE;
    
    // prod
    context.bindings.outputEventHubIoTDataMessagesProd = tempBufferPROD;
    
    context.res = {
        // status: 200, /* Defaults to 200 */
        body: responseMessage
    };
}```

</details>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
anthonychucommented, Mar 1, 2021

@alrod @AnatoliB Could you please evaluate this item for an upcoming sprint? Thanks

1reaction
anthonychucommented, Feb 22, 2021

The issue is possibly here: https://github.com/Azure/azure-functions-eventhubs-extension/blob/51be2e6eccd2b01ab32ebdf80160a9449b718418/src/Microsoft.Azure.WebJobs.Extensions.EventHubs/Config/EventHubOptions.cs#L210-L221

Notice in @KaiWalter’s sample the Event Hubs names are the same, but connection strings are different. However, it appears the extension uses a cache that’s keyed only on the Event Hub name and not the connection string.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Function (JS) not sending events/data to eventhub or ...
The function runs successfully but no event/data is sent to the output eventhub instance. Below are the code and binding files.
Read more >
timeout in Azure functions App binding with events hub to ...
Created function app in Linux environment, I was able to send the data to event hub using the same code you have provided....
Read more >
Azure Functions : A quick demo when using Event Hub
Today I'm going to show you a very brief demo on using an Azure Event Hub as trigger/input for an Azure function.
Read more >
8 Things You Might Not Know About Azure Functions - Split
Bindings can be connected as input bindings, output bindings, or both. Data from bindings is provided to the function as parameters. Imagine ...
Read more >
Azure Functions Event hub read write latency spikes with ...
We resolved the issue - The Azure function was set on a consumption plan - this set it so there was only one...
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