You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-service-bus-trigger.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -370,6 +370,7 @@ The following table explains the properties you can set using this trigger attri
370
370
|**Connection**| The name of an app setting or setting collection that specifies how to connect to Service Bus. See [Connections](#connections).|
371
371
|**IsBatched**| Messages are delivered in batches. Requires an array or collection type. |
372
372
|**IsSessionsEnabled**|`true` if connecting to a [session-aware](../service-bus-messaging/message-sessions.md) queue or subscription. `false` otherwise, which is the default value.|
373
+
|**AutoCompleteMessages**|`true` if the trigger should automatically complete the message after a successful invocation. `false` if it should not, such as when you are [handling message settlement in code](#usage). If not explicitly set, the behavior will be based on the [`autoCompleteMessages` configuration in `host.json`][host-json-autoComplete].|
373
374
374
375
# [In-process model](#tab/in-process)
375
376
@@ -590,9 +591,16 @@ Poison message handling can't be controlled or configured in Azure Functions. Se
590
591
591
592
## PeekLock behavior
592
593
593
-
The Functions runtime receives a message in [PeekLock mode](../service-bus-messaging/service-bus-performance-improvements.md#receive-mode). It calls `Complete` on the message if the function finishes successfully, or calls `Abandon` if the function fails. If the function runs longer than the `PeekLock` timeout, the lock is automatically renewed as long as the function is running.
594
+
The Functions runtime receives a message in [PeekLock mode](../service-bus-messaging/service-bus-performance-improvements.md#receive-mode).
594
595
595
-
The `maxAutoRenewDuration` is configurable in *host.json*, which maps to [ServiceBusProcessor.MaxAutoLockRenewalDuration](/dotnet/api/azure.messaging.servicebus.servicebusprocessor.maxautolockrenewalduration). The default value of this setting is 5 minutes.
596
+
::: zone pivot="programming-language-javascript,programming-language-typescript,programming-language-java,programming-language-python,programming-language-powershell"
597
+
By default, the runtime calls `Complete` on the message if the function finishes successfully, or calls `Abandon` if the function fails. You can disable automatic completion through with the [`autoCompleteMessages` property in `host.json`][host-json-autoComplete].
598
+
::: zone-end
599
+
::: zone pivot="programming-language-csharp"
600
+
By default, the runtime calls `Complete` on the message if the function finishes successfully, or calls `Abandon` if the function fails. You can disable automatic completion through with the [`autoCompleteMessages` property in `host.json`][host-json-autoComplete] or through a [property on the trigger attribute](#attributes). You should disable automatic completion if your function code handles message settlement.
601
+
::: zone-end
602
+
603
+
If the function runs longer than the `PeekLock` timeout, the lock is automatically renewed as long as the function is running. The `maxAutoRenewDuration` is configurable in *host.json*, which maps to [ServiceBusProcessor.MaxAutoLockRenewalDuration](/dotnet/api/azure.messaging.servicebus.servicebusprocessor.maxautolockrenewalduration). The default value of this setting is 5 minutes.
596
604
597
605
::: zone pivot="programming-language-csharp"
598
606
## Message metadata
@@ -696,3 +704,4 @@ Functions version 1.x doesn't support isolated worker process. To use the isolat
696
704
697
705
698
706
[upgrade your application to Functions 4.x]: ./migrate-version-1-version-4.md
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-service-bus.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,9 +261,9 @@ The `clientRetryOptions` settings only apply to interactions with the Service Bu
261
261
|**maxDelay**|`00:01:00`|The maximum delay to allow between retry attempts|
262
262
|**maxRetries**|`3`|The maximum number of retry attempts before considering the associated operation to have failed.|
263
263
|**prefetchCount**|`0`|Gets or sets the number of messages that the message receiver can simultaneously request.|
264
-
|**transportType**| amqpTcp | The protocol and transport that is used for communicating with Service Bus. Available options: `amqpTcp`, `amqpWebSockets`|
265
-
|**webProxy**| n/a | The proxy to use for communicating with Service Bus over web sockets. A proxy cannot be used with the `amqpTcp` transport. |
266
-
|**autoCompleteMessages**|`true`|Determines whether or not to automatically complete messages after successful execution of the function and should be used in place of the `autoComplete` configuration setting.|
264
+
|**transportType**| amqpTcp | The protocol and transport that is used for communicating with Service Bus. Available options: `amqpTcp`, `amqpWebSockets`|
265
+
|**webProxy**| n/a | The proxy to use for communicating with Service Bus over web sockets. A proxy cannot be used with the `amqpTcp` transport. |
266
+
|**autoCompleteMessages**|`true`|Determines whether or not to automatically complete messages after successful execution of the function.|
267
267
|**maxAutoLockRenewalDuration**|`00:05:00`|The maximum duration within which the message lock will be renewed automatically. This setting only applies for functions that receive a single message at a time.|
268
268
|**maxConcurrentCalls**|`16`|The maximum number of concurrent calls to the callback that should be initiated per scaled instance. By default, the Functions runtime processes multiple messages concurrently. This setting is used only when the `isSessionsEnabled` property or attribute on [the trigger](functions-bindings-service-bus-trigger.md) is set to `false`. This setting only applies for functions that receive a single message at a time.|
269
269
|**maxConcurrentSessions**|`8`|The maximum number of sessions that can be handled concurrently per scaled instance. This setting is used only when the `isSessionsEnabled` property or attribute on [the trigger](functions-bindings-service-bus-trigger.md) is set to `true`. This setting only applies for functions that receive a single message at a time.|
Copy file name to clipboardExpand all lines: includes/functions-bindings-service-bus-trigger-dotnet-isolated-types.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,18 @@ When you want the function to process a single message, the Service Bus trigger
13
13
|`string`| The message as a string. Use when the message is simple text. |
14
14
|`byte[]`| The bytes of the message. |
15
15
| JSON serializable types | When an event contains JSON data, Functions tries to deserialize the JSON data into a plain-old CLR object (POCO) type. |
16
-
|[ServiceBusReceivedMessage]<sup>1</sup> | The message object.<br/><br/>When binding to `ServiceBusReceivedMessage`, you can optionally also include a parameter of type [ServiceBusMessageActions]<sup>1</sup> to perform [message settlement] actions.|
16
+
|[ServiceBusReceivedMessage]<sup>1</sup> | The message object.<br/><br/>When binding to `ServiceBusReceivedMessage`, you can optionally also include a parameter of type [ServiceBusMessageActions]<sup>1,2</sup> to perform [message settlement] actions.|
17
17
18
18
When you want the function to process a batch of messages, the Service Bus trigger can bind to the following types:
19
19
20
20
| Type | Description |
21
21
| --- | --- |
22
-
|`T[]` where `T` is one of the single message types | An array of events from the batch. Each entry represents one event.<br/><br/>When binding to `ServiceBusReceivedMessage[]`, you can optionally also include a parameter of type [ServiceBusMessageActions]<sup>1</sup> to perform [message settlement] actions.|
22
+
|`T[]` where `T` is one of the single message types | An array of events from the batch. Each entry represents one event.<br/><br/>When binding to `ServiceBusReceivedMessage[]`, you can optionally also include a parameter of type [ServiceBusMessageActions]<sup>1,2</sup> to perform [message settlement] actions.|
23
23
24
24
<sup>1</sup> To use these types, you need to reference [Microsoft.Azure.Functions.Worker.Extensions.ServiceBus 5.14.1 or later](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.ServiceBus/5.14.1) and the [common dependencies for SDK type bindings](../articles/azure-functions/dotnet-isolated-process-guide.md#sdk-types).
25
25
26
+
<sup>2</sup> When using `ServiceBusMessageActions`, set the [`AutoCompleteMessages` property of the trigger attribute](../articles/azure-functions/functions-bindings-service-bus-trigger.md#attributes) to `false`. This prevents the runtime from attempting to complete messages after a successful function invocation.
0 commit comments