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
i don't receive messages in eventhub
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()
1 answer
Sort by: Most helpful
-
HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
2021-04-29T04:55:48.15+00:00