Pragmatic
Pragmatic

Reputation: 3127

Can multiple azure function read from single partition on event hub

Can multiple azure functions read from single partition on event hub. Can they scale up more then number of partitions in event hub?

Upvotes: 0

Views: 737

Answers (1)

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35134

Yes, that is possible.

Let's say your Event Hub has N partitions. Function might be running on M instances (servers). Each partition will be locked by one of the servers, i.e. two servers won't concurrently process messages from the same partition. M <= N will hold.

Each server may run multiple function executions in parallel. They can be from multiple partitions, but also the server might process several events from the same batch from the same partition at the same time.

The simplest experiment which shows that:

  • 1 partition in Event Hub
  • Azure Function which sleeps for 10 seconds for each event
  • Send 10 events to the hub at the same time

In the logs you will see that they were processed in parallel, not sequentially.

Upvotes: 0

Related Questions