Skip to content

Commit

Permalink
Change node event hub cardinality
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Mason committed Apr 14, 2017
1 parent 24149c4 commit 591cf9b
Show file tree
Hide file tree
Showing 5 changed files with 1,191 additions and 1,156 deletions.
18 changes: 18 additions & 0 deletions Bindings/bindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@
"label": "$eventHubTrigger_connection_label",
"help": "$eventHubTrigger_connection_help",
"placeholder": "[variables('selectConnection')]"
},
{
"name": "cardinality",
"value": "enum",
"required": false,
"defaultValue": "many",
"enum": [
{
"value": "one",
"display": "One"
},
{
"value": "many",
"display": "Many"
}
],
"label": "$eventHubTrigger_cardinality_label",
"help": "$eventHubTrigger_cardinality_help"
}
]
},
Expand Down
14 changes: 10 additions & 4 deletions Documentation/eventHubTrigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The settings for an Azure Event Hub trigger specifies the following properties:
- `direction` : Must be set to *in*.
- `path` : The name of the event hub.
- `connection` : The name of an app setting that contains the connection string to the namespace that the event hub resides in. Copy this connection string by clicking the **Connection Information** button for the namespace, not the event hub itself. This connection string must have at least read permissions to activate the trigger.
- `cardinality` : Cardinality of the trigger input. Choose 'One' if the input is a single message or 'Many' if the input is an array of messages. 'One' is the default if unspecified.

#### Azure Event Hub trigger C# example

Expand All @@ -18,8 +19,13 @@ The settings for an Azure Event Hub trigger specifies the following properties:
}

#### Azure Event Hub trigger JavaScript example

module.exports = function (context, myEventHubMessage) {
context.log('JavaScript eventhub trigger function processed work item', myEventHubMessage);
context.done();

module.exports = function (context, eventHubMessages) {
context.log(`JavaScript eventhub trigger function called for message array ${eventHubMessages}`);
eventHubMessages.forEach(message => {
context.log(`Processed message ${message}`);
});

context.done();
};
Loading

0 comments on commit 591cf9b

Please sign in to comment.