I have a requirement to send data present in a flat file from VM unix server to Azure event hub and to publish to azure blob storage.
I am able to do this using below code
val producer: EventHubProducerClient = new EventHubClientBuilder().connectionString(connectionString, eventHubName).buildProducerClient
val batch: EventDataBatch = producer.createBatch()
Reading the content of my file line by line and sending to tryAdd methos.
for (line <- fileContent.getLines)
{
batch.tryAdd(new EventData(fileLine)) }
// send the batch of events to the event hub
//producer.send(batch)
// close the producer
producer.close()
My file has got about 1000 records. For it Event hub has created about 12 requests (Seems this is doing randomly).
I am just trying to understand on what basis event hub creates the requests and is there a way I can control it?
Any info around it would be very helpful