using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.EventHubs;
namespace DemoEventGenerator
static double _probability = 0.01;
static int _transactions = 0;
static int _cardNumber = -1;
static string eventHubConnectionString = "Endpoint=sb://poc-json-send.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=8mkEjirEFUN7w/msU7baOiXNP0Q3NYiRptfmI5s4m1M=";
static void SendingRandomMessages()
EventHubsConnectionStringBuilder connectionStringBuilder = new EventHubsConnectionStringBuilder(eventHubConnectionString)
EntityPath = "poc-json-send"
EventHubClient eventHubClient = EventHubClient.CreateFromConnectionString(connectionStringBuilder.ToString());
string message = "hello world";
Console.WriteLine($"Sending message: {message}");
await eventHubClient.SendAsync(new EventData(Encoding.UTF8.GetBytes(message)));
public static void Main(){