Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to Azure.messaging.EventHubs #5

Merged
merged 3 commits into from
Oct 19, 2020

Conversation

FrankieTF
Copy link

Updated target:

  • Remove the reference to the WindowsAzure.ServiceBus package
  • Remove the references to each of the Microsoft.Azure* and Microsoft.IdentityModel.* packages
  • Using package Azure.Messaging.EventHubs
  • Replace Thread.Sleep with Task.Delay
  • Rename the EventHub2 folder to EventHubSampleSendData

@jongio
Copy link
Member

jongio commented Sep 30, 2020

@jsquire - Can you please review?

EventHubSampleData/EventHubSampleSendData/packages.config Outdated Show resolved Hide resolved
EventHubSampleData/EventHubSampleSendData/Program.cs Outdated Show resolved Hide resolved
await using (var producerClient = new EventHubProducerClient(connectionString, eventHubName))
{
int counter = 0;
for (int i = 0; i < 100; i++)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd advise not using a single-letter variable name. What purpose does the loop index serve here and how does that differ from counter? It may be better to use a while loop and key off of counter.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here "i" stands for how many messages were sent. "counters" was used to count the numbers in each message.
In this sample, it means 100 meassages and 3 records in each message.
This kinds of how to send message to EventHub is same with how mono sample does. So i am prefer keeping this for loop.
Do you agree with this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the context. I'd agree that keeping the structure makes sense. Can we rename to amountSent or sendCount to try and represent the semantics of it?

EventHubSampleData/EventHubSampleSendData/Program.cs Outdated Show resolved Hide resolved
EventHubSampleData/EventHubSampleSendData/Program.cs Outdated Show resolved Hide resolved
await using (var producerClient = new EventHubProducerClient(connectionString, eventHubName))
{
int counter = 0;
for (int i = 0; i < 100; i++)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the context. I'd agree that keeping the structure makes sense. Can we rename to amountSent or sendCount to try and represent the semantics of it?

@jongio jongio merged commit 38a4da0 into Azure-Samples:master Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants