Skip to content

Commit aea4dc3

Browse files
authored
Update LineCounter sample versions (Azure#16128)
1 parent bed3f36 commit aea4dc3

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

samples/linecounter/BlobProcessorHost.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
using System.Threading;
99
using System.Threading.Tasks;
1010
using Azure.Messaging.EventHubs;
11+
using Azure.Messaging.EventHubs.Consumer;
1112
using Azure.Messaging.EventHubs.Processor;
13+
using Azure.Messaging.EventHubs.Producer;
1214
using Azure.Storage.Blobs;
1315
using Microsoft.Extensions.Azure;
1416
using Microsoft.Extensions.Configuration;
@@ -60,9 +62,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
6062

6163
private async Task ProcessEvent(ProcessEventArgs eventArgs)
6264
{
63-
// Note there is a bug with the HasEvent property in Preview 6, so check if Data is not null as work around.
64-
// https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_EventProcessingHeartbeat.cs#L85
65-
if (eventArgs.Data != null)
65+
if (eventArgs.HasEvent)
6666
{
6767
var totalCount = 0;
6868
var cancellationToken = _cancellationTokenSource.Token;

samples/linecounter/Controllers/HomeController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Azure.Messaging.EventHubs;
7+
using Azure.Messaging.EventHubs.Producer;
78
using Azure.Storage.Blobs;
89
using Microsoft.AspNetCore.Mvc;
910
using Microsoft.Extensions.Azure;

samples/linecounter/LineCounter.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<UserSecretsId>67ca5d37-051b-4ab1-b013-c74a2d4edb76</UserSecretsId>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.0.0-preview.6" />
8-
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.0.0-preview.6" />
9-
<PackageReference Include="Azure.Storage.Blobs" Version="12.1.0" />
10-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.0" />
7+
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.2.0" />
8+
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.2.0" />
9+
<PackageReference Include="Azure.Storage.Blobs" Version="12.6.0" />
10+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.15.0" />
1111
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.0.0" />
1212
</ItemGroup>
1313
<ItemGroup>

0 commit comments

Comments
 (0)