Skip to content

Commit 8f87925

Browse files
authored
Merge pull request #191897 from ggailey777/patch-3
Adding tabs and host.json to event hubs
2 parents 09a9e0a + c72511a commit 8f87925

File tree

3 files changed

+121
-114
lines changed

3 files changed

+121
-114
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Configuration settings for the [Azure Cosmos DB trigger and bindings](functions-
144144

145145
## eventHub
146146

147-
Configuration settings for [Event Hub triggers and bindings](functions-bindings-event-hubs.md#functions-1x).
147+
Configuration settings for [Event Hub triggers and bindings](functions-bindings-event-hubs.md?tabs=functionsv1#hostjson-settings).
148148

149149
## functions
150150

includes/functions-bindings-event-hubs.md

Lines changed: 120 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Supports the original Event Hubs binding parameter type of [Microsoft.Azure.Even
4141

4242
Add the extension to your project by installing the [NuGet package], version 3.x or 4.x.
4343

44+
# [Functions v1.x](#tab/functionsv1/in-process)
45+
46+
Version 1.x of the Functions runtime doesn't require an extension.
47+
4448
# [Extension v5.x+](#tab/extensionv5/isolated-process)
4549

4650
[!INCLUDE [functions-bindings-event-hubs-extension-5](functions-bindings-event-hubs-extension-5.md)]
@@ -51,6 +55,10 @@ Add the extension to your project by installing the [NuGet package](https://www.
5155

5256
Add the extension to your project by installing the [NuGet package](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.EventHubs), version 4.x.
5357

58+
# [Functions v1.x](#tab/functionsv1/isolated-process)
59+
60+
Version 1.x of the Functions runtime doesn't supported running in an isolated process.
61+
5462
# [Extension v5.x+](#tab/extensionv5/csharp-script)
5563

5664
[!INCLUDE [functions-bindings-event-hubs-extension-5](functions-bindings-event-hubs-extension-5.md)]
@@ -65,6 +73,10 @@ Supports the original Event Hubs binding parameter type of [Microsoft.Azure.Even
6573

6674
You can install this version of the extension in your function app by registering the [extension bundle], version 2.x.
6775

76+
# [Functions v1.x](#tab/functionsv1/csharp-script)
77+
78+
Version 1.x of the Functions runtime doesn't require an extension.
79+
6880
---
6981

7082
::: zone-end
@@ -97,17 +109,122 @@ To learn more, see [Update your extensions].
97109

98110
You can install this version of the extension in your function app by registering the [extension bundle], version 2.x.
99111

112+
# [Functions v1.x](#tab/functionsv1)
113+
114+
Version 1.x of the Functions runtime doesn't require extension bundles.
115+
100116
---
101117

102118
::: zone-end
103119

104120
## host.json settings
105121
<a name="host-json"></a>
106122

107-
The [host.json](../articles/azure-functions/functions-host-json.md#eventhub) file contains settings that control behavior for the Event Hubs trigger. The configuration is different depending on the Azure Functions version.
123+
The [host.json](../articles/azure-functions/functions-host-json.md#eventhub) file contains settings that control behavior for the Event Hubs trigger. The configuration is different depending on the extension version.
124+
125+
# [Extension v5.x+](#tab/extensionv5)
126+
127+
```json
128+
{
129+
"version": "2.0",
130+
"extensions": {
131+
"eventHubs": {
132+
"maxEventBatchSize" : 10,
133+
"batchCheckpointFrequency" : 5,
134+
"prefetchCount" : 300,
135+
"transportType" : "amqpWebSockets",
136+
"webProxy" : "https://proxyserver:8080",
137+
"customEndpointAddress" : "amqps://company.gateway.local",
138+
"initialOffsetOptions" : {
139+
"type" : "fromStart",
140+
"enqueuedTimeUtc" : ""
141+
},
142+
"clientRetryOptions":{
143+
"mode" : "exponential",
144+
"tryTimeout" : "00:01:00",
145+
"delay" : "00:00:00.80",
146+
"maxDelay" : "00:01:00",
147+
"maxRetries" : 3
148+
}
149+
}
150+
}
151+
}
152+
```
153+
154+
|Property |Default | Description |
155+
|---------|---------|---------|
156+
| maxEventBatchSize| 10| The maximum number of events that will be included in a batch for a single invocation. Must be at least 1.|
157+
| batchCheckpointFrequency| 1| The number of batches to process before creating a checkpoint for the event hub.|
158+
| prefetchCount| 300| The number of events that will be eagerly requested from Event Hubs and held in a local cache to allow reads to avoid waiting on a network operation|
159+
| transportType| amqpTcp | The protocol and transport that is used for communicating with Event Hubs. Available options: `amqpTcp`, `amqpWebSockets`|
160+
| webProxy| | The proxy to use for communicating with Event Hubs over web sockets. A proxy cannot be used with the `amqpTcp` transport. |
161+
| customEndpointAddress | | The address to use when establishing a connection to Event Hubs, allowing network requests to be routed through an application gateway or other path needed for the host environment. The fully qualified namespace for the event hub is still needed when a custom endpoint address is used and must be specified explicitly or via the connection string.|
162+
| initialOffsetOptions/type | fromStart| The location in the event stream to start processing when a checkpoint does not exist in storage. Applies to all partitions. For more information, see the [OffsetType documentation](/dotnet/api/microsoft.azure.webjobs.eventhubs.offsettype). Available options: `fromStart`, `fromEnd`, `fromEnqueuedTime`|
163+
| initialOffsetOptions/enqueuedTimeUtc | | Specifies the enqueued time of the event in the stream from which to start processing. When `initialOffsetOptions/type` is configured as `fromEnqueuedTime`, this setting is mandatory. Supports time in any format supported by [DateTime.Parse()](/dotnet/standard/base-types/parsing-datetime), such as `2020-10-26T20:31Z`. For clarity, you should also specify a timezone. When timezone isn't specified, Functions assumes the local timezone of the machine running the function app, which is UTC when running on Azure. |
164+
| clientRetryOptions/mode | exponential | The approach to use for calculating retry delays. Exponential mode will retry attempts with a delay based on a back-off strategy where each attempt will increase the duration that it waits before retrying. The fixed mode will retry attempts at fixed intervals with each delay having a consistent duration. Available options: `exponential`, `fixed`|
165+
| clientRetryOptions/tryTimeout | 00:01:00 | The maximum duration to wait for an Event Hubs operation to complete, per attempt.|
166+
| clientRetryOptions/delay | 00:00:00.80 | The delay or back-off factor to apply between retry attempts.|
167+
| clientRetryOptions/maxDelay | 00:00:01 | The maximum delay to allow between retry attempts. |
168+
| clientRetryOptions/maxRetries | 3 | The maximum number of retry attempts before considering the associated operation to have failed.|
169+
170+
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).
171+
172+
# [Extension v3.x+](#tab/extensionv3)
173+
174+
```json
175+
{
176+
"version": "2.0",
177+
"extensions": {
178+
"eventHubs": {
179+
"batchCheckpointFrequency": 5,
180+
"eventProcessorOptions": {
181+
"maxBatchSize": 256,
182+
"prefetchCount": 512
183+
},
184+
"initialOffsetOptions": {
185+
"type": "fromStart",
186+
"enqueuedTimeUtc": ""
187+
}
188+
}
189+
}
190+
}
191+
```
192+
193+
|Property |Default | Description |
194+
|---------|---------|---------|
195+
|batchCheckpointFrequency|1|The number of event batches to process before creating an EventHub cursor checkpoint.|
196+
|eventProcessorOptions/maxBatchSize|10|The maximum event count received per receive loop.|
197+
|eventProcessorOptions/prefetchCount|300|The default prefetch count used by the underlying `EventProcessorHost`. The minimum allowed value is 10.|
198+
|initialOffsetOptions/type<sup>1</sup>|fromStart|The location in the event stream from which to start processing when a checkpoint doesn't exist in storage. Options are `fromStart` , `fromEnd` or `fromEnqueuedTime`. `fromEnd` processes new events that were enqueued after the function app started running. Applies to all partitions. For more information, see the [EventProcessorOptions documentation](/dotnet/api/microsoft.azure.eventhubs.processor.eventprocessoroptions.initialoffsetprovider).|
199+
|initialOffsetOptions/enqueuedTimeUtc<sup>1</sup>| | Specifies the enqueued time of the event in the stream from which to start processing. When `initialOffsetOptions/type` is configured as `fromEnqueuedTime`, this setting is mandatory. Supports time in any format supported by [DateTime.Parse()](/dotnet/standard/base-types/parsing-datetime), such as `2020-10-26T20:31Z`. For clarity, you should also specify a timezone. When timezone isn't specified, Functions assumes the local timezone of the machine running the function app, which is UTC when running on Azure. For more information, see the [EventProcessorOptions documentation](/dotnet/api/microsoft.azure.eventhubs.processor.eventprocessoroptions.initialoffsetprovider).|
200+
201+
<sup>1</sup> Support for `initialOffsetOptions` begins with [EventHubs v4.2.0](https://github.com/Azure/azure-functions-eventhubs-extension/releases/tag/v4.2.0).
202+
203+
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).
204+
205+
# [Functions v1.x](#tab/functionsv1)
206+
207+
```json
208+
{
209+
"eventHub": {
210+
"maxBatchSize": 64,
211+
"prefetchCount": 256,
212+
"batchCheckpointFrequency": 1
213+
}
214+
}
215+
```
216+
217+
|Property |Default | Description |
218+
|---------|---------|---------|
219+
|maxBatchSize|64|The maximum event count received per receive loop.|
220+
|prefetchCount| 300 |The default prefetch that will be used by the underlying `EventProcessorHost`.|
221+
|batchCheckpointFrequency|1|The number of event batches to process before creating an EventHub cursor checkpoint.|
222+
223+
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).
224+
225+
---
108226

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

111228
[NuGet package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs
112229
[extension bundle]: ../articles/azure-functions/functions-bindings-register.md#extension-bundles
113-
[Update your extensions]: ../articles/azure-functions/functions-bindings-register.md
230+
[Update your extensions]: ../articles/azure-functions/functions-bindings-register.md

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

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)