Azure / Azure/azure-functions-java-library
Event Hub Trigger does not process the messages of a partition sequentially
- Ngôn ngữ chính
- Java
- Star
- 45
- Fork
- 49
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi,
we are using the Event Hub trigger in a Java-based Azure function for processing messages from IoT Hub. We are relying on the fact that message are processed from a partition in the order that they were written to the Event Hub partition, or more specifically that messages with the same partition key are sequentially processed by a single thread. This property of Event Hub partitions is referenced in several places of the documentation, e.g.
> Within each partition, events remain in production order
> Use keys when consumers need to receive events in production order. Since all events with the same key go to the same partition, events with key values can maintain their order during processing"
Source: https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka
> In some scenarios, the ordering of events can be important. For example, you may want your back-end system to process an update command before a delete command. In this scenario, a client application sends events to a specific partition so that the ordering is preserved. When a consumer application consumes these events from the partition, they are read in order
Source: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-availability-and-consistency?tabs=dotnet
We have found that at least in Java Azure Functions using the Event Hub trigger this is not the case. Instead the messages seem to be dispatched to a thread pool, so that messages of the same partition are often executed concurrently and out of order.
Please advise if this behavior can be changed using configuration. Coming from Apache Kafka that uses the same partitioning and concurrency concept, we were very surprised that upholding the message and processing ordering guarantee per partition is not the default behavior.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách xem xét hành vi của Java Azure Functions Event Hub trigger được mô tả trong báo cáo, tập trung vào việc gán partition, điều phối qua thread-pool và cấu hình hiện có. Xác nhận xem các message trong cùng một partition có thể được thực thi đồng thời và không theo thứ tự hay không, sau đó ghi lại cấu hình được hỗ trợ hoặc hành vi cần thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, java
- Lĩnh vực
- backend, cloud
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100