i don't receive messages in eventhub

Nadine Ben harrath 6 Reputation points
2021-04-28T03:11:05.51+00:00

Hello ,
when i send csv file to eventhub i receive requests but no messages
how can i handle this problem
this my code
import asyncio
from azure.eventhub.aio import EventHubProducerClient
from azure.eventhub import EventData

async def run():
producer = EventHubProducerClient.from_connection_string(conn_str=connection_str, eventhub_name=eventhub_name)
async with producer:
# Create a batch.
event_data_batch =producer.create_batch()
for claim in (json.loads(data.to_json(orient="records"))):
event_data_batch.add(EventData(claim))
# Send the batch of events to the event hub.
await producer.send_batch(event_data_batch)
producer.close()

Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
637 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    2021-04-29T04:55:48.15+00:00

    Hello @Nadine Ben harrath ,
    Thanks for the ask and using the Microsoft Q&A platform .
    The code which you have posted , I am not sure as to where is the CSV data . Anyways I think the bellow post should help you solve the ask .
    https://stackoverflow.com/questions/57743068/how-to-send-a-csv-file-record-by-record-to-an-azure-event-hub-using-python-as-a
    Please do let me know how it goes .
    Thanks
    Himanshu

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.