MSOP-7727 added Redisques batch queue support#770
Conversation
|
|
Could you please add some documentation what this feature is about? How is the batchQueue property used, etc. It is quite hard to make a review when not knowing what's it about. Have you took a look at the gateleen-packing module? Isn't this what you are trying to achieve? |
|
@mcweba This looks like packing module, but it use for dequeue, vertx-redisques normally send queue items one by one, but now it supports send many queue items in a batch. yes I will add more documents |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #770 +/- ##
=============================================
+ Coverage 49.35% 49.67% +0.32%
- Complexity 2016 2045 +29
=============================================
Files 244 244
Lines 12771 12893 +122
Branches 1368 1392 +24
=============================================
+ Hits 6303 6405 +102
- Misses 5882 5890 +8
- Partials 586 598 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
AI helped me to list potential problems with this new feature: Potential Problems with Batched Queue Feature1. Silent Data Loss// Only first item's routing info used - rest silently discarded
2. Atomicity IssuesScenarios
No per-item success/failure tracking! 3. Error Attribution ImpossibleIf the backend returns 400 Bad Request:
4. Payload Format Assumptions
5. Expiry Check Flawed
6. Timeout Inheritance
7. Circuit Breaker Distortion
8. Monitoring Inaccuracyif(monitoringHandler != null) {
monitoringHandler.updateDequeue(); // Called once, not N times
}
9. Size/Limit Risks
10. Tight Backend Coupling
11. Queue Semantics ViolationNormal queue contract: "Each item processed independently" 12. No Batch-Level Error Handling} catch (Exception exception) {
log.error("Could not build batched request: {} ...", exception.getMessage());
message.reply(new JsonObject().put(STATUS, ERROR).put(MESSAGE, exception.getMessage()));
return;
}
SummaryThe feature trades correctness and observability for throughput. It's only safe when:
Honestly, I see more problems than benefits with this solution. Consuming single queue items over the EventBus should be fast. Why don't you just implement a custom queue processor (maybe in Houston/Eagle) to consume multiple queue items and process them as a batch? |
|
Thanks for helpful comments. For sure the technical issues must be taken in account. We discussed in deep about different solutions for this dedicated use case. For some cases it might really make sense where as for others it doesn't. And all the mentioned drawbacks must be properly described in the usage guide where no common solutions are possible. In the case of about 1000's of messages per second and multiple Pods all receiving them, the receiption by item makes simply no more sense and causes a lot of non necessary network traffic (yes, we hit limitations there). It simply as well get's to a maximum number of messages which is much lower that when sending in batches in dedicated use case. Just some first thoughts about: 10/11 and others) The client decides to consume this way and therefore must be changed and prepared anyway. If the client does not request it, it must not change at all the way the system behaves now. 1/2/ and others) Logging of invalid item belongs to the consuming client. It is totally foreseen that all items in the batch are retried. If a client can't deal with that, it should simply not use it :-)
About the proposed alternative, this simply makes no difference, most of the mentioned problems remain and the message bus load remains high which we wan't to get down as well with this for certain dedicated well matching use cases. Proper documentation of the remaining drawbacks is mandatory of course. |
2.1 that is by design
|
As @Kusig mentioned, we need a really good documentation including drawbacks and potential problems. |
added supports of batch queue from Redisques