Skip to content

Commit 89c37f7

Browse files
committed
CLI example
1 parent 2da64c7 commit 89c37f7

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

articles/event-grid/delivery-and-retry.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: spelluru
66

77
ms.service: event-grid
88
ms.topic: conceptual
9-
ms.date: 05/15/2019
9+
ms.date: 02/27/2020
1010
ms.author: spelluru
1111
---
1212

@@ -22,13 +22,34 @@ Event Grid defaults to sending each event individually to subscribers. The subsc
2222

2323
Batched delivery has two settings:
2424

25-
* **Max events per batch** is the maximum number of events Event Grid will deliver per batch. This number will never be exceeded, however fewer events may be delivered if no other events are available at the time of publish. Event Grid does not delay events in order to create a batch if fewer events are available. Must be between 1 and 5,000.
26-
* **Preferred batch size in kilobytes** is the target ceiling for batch size in kilobytes. Similar to max events, the batch size may be smaller if more events are not available at the time of publish. It is possible that a batch is larger than the preferred batch size *if* a single event is larger than the preferred size. For example, if the preferred size is 4 KB and a 10-KB event is pushed to Event Grid, the 10-KB event will still be delivered in its own batch rather than being dropped.
25+
* **Max events per batch** - Maximum number of events Event Grid will deliver per batch. This number will never be exceeded, however fewer events may be delivered if no other events are available at the time of publish. Event Grid does not delay events in order to create a batch if fewer events are available. Must be between 1 and 5,000.
26+
* **Preferred batch size in kilobytes** - Target ceiling for batch size in kilobytes. Similar to max events, the batch size may be smaller if more events are not available at the time of publish. It is possible that a batch is larger than the preferred batch size *if* a single event is larger than the preferred size. For example, if the preferred size is 4 KB and a 10-KB event is pushed to Event Grid, the 10-KB event will still be delivered in its own batch rather than being dropped.
2727

2828
Batched delivery in configured on a per-event subscription basis via the portal, CLI, PowerShell, or SDKs.
2929

30+
### Azure portal:
3031
![Batch delivery settings](./media/delivery-and-retry/batch-settings.png)
3132

33+
### Azure CLI
34+
When creating an event subscription, use the following parameters:
35+
36+
- **max-events-per-batch** - Maximum number of events in a batch. Must be a number between 1 and 5000.
37+
- **preferred-batch-size-in-kilobytes** - Preferred batch size in kilobytes. Must be a number between 1 and 1024.
38+
39+
```azurecli
40+
storageid=$(az storage account show --name <storage_account_name> --resource-group <resource_group_name> --query id --output tsv)
41+
endpoint=https://$sitename.azurewebsites.net/api/updates
42+
43+
az eventgrid event-subscription create \
44+
--resource-id $storageid \
45+
--name <event_subscription_name> \
46+
--endpoint $endpoint \
47+
--max-events-per-batch 1000 \
48+
--preferred-batch-size-in-kilobytes 512
49+
```
50+
51+
For more information on using Azure CLI with Event Grid, see [Route storage events to web endpoint with Azure CLI](../storage/blobs/storage-blob-event-quickstart.md).
52+
3253
## Retry schedule and duration
3354

3455
Event Grid waits 30 seconds for a response after delivering a message. After 30 seconds, if the endpoint hasn’t responded, the message is queued for retry. Event Grid uses an exponential backoff retry policy for event delivery. Event Grid retries delivery on the following schedule on a best effort basis:

0 commit comments

Comments
 (0)