Skip to content

Commit a2e14d4

Browse files
authored
Merge pull request #112007 from spelluru/ehubqs0420
update the checkpoint
2 parents 9b85864 + d2e81f8 commit a2e14d4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

articles/event-hubs/get-started-dotnet-standard-send-v2.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.devlang: na
1212
ms.topic: quickstart
1313
ms.tgt_pltfrm: na
1414
ms.workload: na
15-
ms.date: 02/11/2020
15+
ms.date: 04/20/2020
1616
ms.author: spelluru
1717

1818
---
@@ -199,11 +199,13 @@ In this quickstart, you use Azure Storage as the checkpoint store. Follow these
199199
1. Now, add the following event and error handler methods to the class.
200200
201201
```csharp
202-
static Task ProcessEventHandler(ProcessEventArgs eventArgs)
203-
{
202+
static async Task ProcessEventHandler(ProcessEventArgs eventArgs)
203+
{
204204
// Write the body of the event to the console window
205-
Console.WriteLine("\tReceived event: {0}", Encoding.UTF8.GetString(eventArgs.Data.Body.ToArray()));
206-
return Task.CompletedTask;
205+
Console.WriteLine("\tRecevied event: {0}", Encoding.UTF8.GetString(eventArgs.Data.Body.ToArray()));
206+
207+
// Update checkpoint in the blob storage so that the app receives only new events the next time it's run
208+
await eventArgs.UpdateCheckpointAsync(eventArgs.CancellationToken);
207209
}
208210
209211
static Task ProcessErrorHandler(ProcessErrorEventArgs eventArgs)

0 commit comments

Comments
 (0)