My Requirement is i should read 1000 messages from event hub at a time in azure databricks and do some processing and then read the next 1000 messages in the queue.
On a whole i should continously read 1000 messages at a time.
My Requirement is i should read 1000 messages from event hub at a time in azure databricks and do some processing and then read the next 1000 messages in the queue.
On a whole i should continously read 1000 messages at a time.
You need to set value of maxEventsPerTrigger to 1000.
maxEventsPerTrigger - Rate limit on maximum number of events processed per trigger interval. The specified total number of events will be proportionally split across partitions of different volume.
Sample Code -
import org.apache.spark.eventhubs.
val cs = "<your-connection-string>"
val eventHubsConf = EventHubsConf(cs)
.setConsumerGroup("sample-cg")
.setMaxEventsPerTrigger(10000)