Skip to content

Commit 9c7796e

Browse files
Merge pull request #111260 from mcollier/mcollier-update-event-hub-host-json
Move Event Hub related host.json settings to a single location.
2 parents e5057eb + c2ff3ca commit 9c7796e

File tree

6 files changed

+41
-39
lines changed

6 files changed

+41
-39
lines changed

articles/app-service/webjobs-sdk-how-to.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ In version 3.*x*, the connection limit defaults to infinite connections. If for
122122

123123
In version 2.*x*, you control the number of concurrent connections to a host by using the [ServicePointManager.DefaultConnectionLimit](/dotnet/api/system.net.servicepointmanager.defaultconnectionlimit#System_Net_ServicePointManager_DefaultConnectionLimit) API. In 2.*x*, you should increase this value from the default of 2 before starting your WebJobs host.
124124

125-
All outgoing HTTP requests that you make from a function by using `HttpClient` flow through `ServicePointManager`. After you reach the value set in `DefaultConnectionLimit`, `ServicePointManager` starts queueing requests before sending them. Suppose your `DefaultConnectionLimit` is set to 2 and your code makes 1,000 HTTP requests. Initially, only two requests are allowed through to the OS. The other 998 are queued until theres room for them. That means your `HttpClient` might time out because it appears to have made the request, but the request was never sent by the OS to the destination server. So you might see behavior that doesn't seem to make sense: your local `HttpClient` is taking 10 seconds to complete a request, but your service is returning every request in 200 ms.
125+
All outgoing HTTP requests that you make from a function by using `HttpClient` flow through `ServicePointManager`. After you reach the value set in `DefaultConnectionLimit`, `ServicePointManager` starts queueing requests before sending them. Suppose your `DefaultConnectionLimit` is set to 2 and your code makes 1,000 HTTP requests. Initially, only two requests are allowed through to the OS. The other 998 are queued until there's room for them. That means your `HttpClient` might time out because it appears to have made the request, but the request was never sent by the OS to the destination server. So you might see behavior that doesn't seem to make sense: your local `HttpClient` is taking 10 seconds to complete a request, but your service is returning every request in 200 ms.
126126

127127
The default value for ASP.NET applications is `Int32.MaxValue`, and that's likely to work well for WebJobs running in a Basic or higher App Service Plan. WebJobs typically need the Always On setting, and that's supported only by Basic and higher App Service Plans.
128128

@@ -420,7 +420,7 @@ static async Task Main()
420420
}
421421
```
422422

423-
For more details, see the [Event Hubs binding](../azure-functions/functions-bindings-event-hubs-output.md#hostjson-settings) article.
423+
For more details, see the [Event Hubs binding](../azure-functions/functions-bindings-event-hubs-trigger.md#host-json) article.
424424

425425
### Queue storage trigger configuration
426426

articles/azure-functions/functions-host-json-v1.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ Configuration settings for the [Azure Cosmos DB trigger and bindings](functions-
143143

144144
## eventHub
145145

146-
Configuration settings for [Event Hub triggers and bindings](functions-bindings-event-hubs.md).
147-
148-
[!INCLUDE [functions-host-json-event-hubs](../../includes/functions-host-json-event-hubs.md)]
146+
Configuration settings for [Event Hub triggers and bindings](functions-bindings-event-hubs-trigger.md#functions-1x).
149147

150148
## functions
151149

articles/azure-functions/functions-host-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Configuration setting can be found in [bindings for Durable Functions](durable/d
211211

212212
## eventHub
213213

214-
Configuration settings can be found in [Event Hub triggers and bindings](functions-bindings-event-hubs-output.md#host-json).
214+
Configuration settings can be found in [Event Hub triggers and bindings](functions-bindings-event-hubs-trigger.md#host-json).
215215

216216
## extensions
217217

includes/functions-bindings-event-hubs-output.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -288,33 +288,3 @@ There are two options for outputting an Event Hub message from a function by usi
288288
| Binding | Reference |
289289
|---|---|
290290
| Event Hub | [Operations Guide](https://docs.microsoft.com/rest/api/eventhub/publisher-policy-operations) |
291-
292-
<a name="host-json"></a>
293-
294-
## host.json settings
295-
296-
This section describes the global configuration settings available for this binding in versions 2.x and higher. The example host.json file below contains only the version 2.x+ settings for this binding. For more information about global configuration settings in versions 2.x and beyond, see [host.json reference for Azure Functions](../articles/azure-functions/functions-host-json.md).
297-
298-
> [!NOTE]
299-
> For a reference of host.json in Functions 1.x, see [host.json reference for Azure Functions 1.x](../articles/azure-functions/functions-host-json-v1.md).
300-
301-
```json
302-
{
303-
"version": "2.0",
304-
"extensions": {
305-
"eventHubs": {
306-
"batchCheckpointFrequency": 5,
307-
"eventProcessorOptions": {
308-
"maxBatchSize": 256,
309-
"prefetchCount": 512
310-
}
311-
}
312-
}
313-
}
314-
```
315-
316-
|Property |Default | Description |
317-
|---------|---------|---------|
318-
|`maxBatchSize`|10|The maximum event count received per receive loop.|
319-
|`prefetchCount`|300|The default pre-fetch count used by the underlying `EventProcessorHost`.|
320-
|`batchCheckpointFrequency`|1|The number of event batches to process before creating an EventHub cursor checkpoint.|

includes/functions-bindings-event-hubs-trigger.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ The following table explains the binding configuration properties that you set i
350350
|**path** |**EventHubName** | Functions 1.x only. The name of the event hub. When the event hub name is also present in the connection string, that value overrides this property at runtime. |
351351
|**eventHubName** |**EventHubName** | Functions 2.x and higher. The name of the event hub. When the event hub name is also present in the connection string, that value overrides this property at runtime. Can be referenced via app settings %eventHubName% |
352352
|**consumerGroup** |**ConsumerGroup** | An optional property that sets the [consumer group](../articles/event-hubs/event-hubs-features.md#event-consumers) used to subscribe to events in the hub. If omitted, the `$Default` consumer group is used. |
353-
|**cardinality** | n/a | For Javascript. Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function. |
353+
|**cardinality** | n/a | For JavaScript. Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function. |
354354
|**connection** |**Connection** | The name of an app setting that contains the connection string to the event hub's namespace. Copy this connection string by clicking the **Connection Information** button for the [namespace](../articles/event-hubs/event-hubs-create.md#create-an-event-hubs-namespace), not the event hub itself. This connection string must have at least read permissions to activate the trigger.|
355355

356356
[!INCLUDE [app settings to local.settings.json](../articles/azure-functions/../../includes/functions-app-settings-local.md)]
@@ -372,7 +372,8 @@ The Event Hubs trigger provides several [metadata properties](../articles/azure-
372372
See [code examples](#example) that use these properties earlier in this article.
373373

374374
## host.json properties
375+
<a name="host-json"></a>
375376

376-
The [host.json](../articles/azure-functions/functions-host-json.md#eventhub) file contains settings that control Event Hubs trigger behavior.
377+
The [host.json](../articles/azure-functions/functions-host-json.md#eventhub) file contains settings that control Event Hubs trigger behavior. The configuration is different depending on the Azure Functions version.
377378

378379
[!INCLUDE [functions-host-json-event-hubs](../articles/azure-functions/../../includes/functions-host-json-event-hubs.md)]

includes/functions-host-json-event-hubs.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ ms.topic: include
55
ms.date: 09/04/2018
66
ms.author: glenga
77
---
8+
9+
### Functions 2.x and higher
10+
11+
```json
12+
{
13+
"version": "2.0",
14+
"extensions": {
15+
"eventHubs": {
16+
"batchCheckpointFrequency": 5,
17+
"eventProcessorOptions": {
18+
"maxBatchSize": 256,
19+
"prefetchCount": 512
20+
}
21+
}
22+
}
23+
}
24+
```
25+
26+
|Property |Default | Description |
27+
|---------|---------|---------|
28+
|maxBatchSize|10|The maximum event count received per receive loop.|
29+
|prefetchCount|300|The default pre-fetch count used by the underlying `EventProcessorHost`.|
30+
|batchCheckpointFrequency|1|The number of event batches to process before creating an EventHub cursor checkpoint.|
31+
32+
> [!NOTE]
33+
> For a reference of host.json in Azure Functions 2.x and beyond, see [host.json reference for Azure Functions](../articles/azure-functions/functions-host-json.md).
34+
35+
### Functions 1.x
36+
837
```json
938
{
1039
"eventHub": {
@@ -18,5 +47,9 @@ ms.author: glenga
1847
|Property |Default | Description |
1948
|---------|---------|---------|
2049
|maxBatchSize|64|The maximum event count received per receive loop.|
21-
|prefetchCount|n/a|The default PrefetchCount that will be used by the underlying EventProcessorHost.|
50+
|prefetchCount|n/a|The default pre-fetch that will be used by the underlying `EventProcessorHost`.|
2251
|batchCheckpointFrequency|1|The number of event batches to process before creating an EventHub cursor checkpoint.|
52+
53+
> [!NOTE]
54+
> For a reference of host.json in Azure Functions 1.x, see [host.json reference for Azure Functions 1.x](../articles/azure-functions/functions-host-json-v1.md).
55+

0 commit comments

Comments
 (0)