I am trying to send data to an azure event hub later to be consumed by stream analytics and PowerBI.
My C# application is sending a simple test string (JSON formatted) while I am testing the Event Hub, but when I want to process the data in the event hub it tells me no data has been sent.
I am unsure how to debug the hub to see why the message does not show up, I tried google for a debug document but found none when searching for debugging azure event hubs
How can I find any error messages about this?
My C# code is simplified like this for testing purposes
private async Task SendMessageToEventHub(string messageToSend)
{
var connectionStringBuilder = new EventHubsConnectionStringBuilder(EventHubConnectionString)
{
EntityPath = EventHubName
};
eventHubClient = EventHubClient.CreateFromConnectionString(connectionStringBuilder.ToString());
try
{
await eventHubClient.SendAsync(new EventData(Encoding.UTF8.GetBytes(messageToSend)));
} catch (Exception exception) {
_logger.LogInformation($"-PimLog- -ProductInfoController- {DateTime.Now}, > Exception: {exception.Message} ");
}
_logger.LogInformation($"-PimLog- -ProductInfoController- {DateTime.Now}, EventHub Message Sent Successfully ");
}
I do see the log message that Message Sent Successfully so no obvious error is there.
When I try and run the query in the azure portal I get the following message
There is no data from input 'pimhub'. Please make sure the input source has data and then try again.
How can I debug further?