Conversation
- Added `RetryPolicy` struct to control backoff timing for message redelivery after nacks or deadline expirations. - Implemented `parse_retry_policy` function to parse retry policy from proto representation. - Integrated retry policy into subscription handling, allowing for configurable backoff behavior. - Introduced `RetryQueue` to manage messages waiting for their retry backoff delay. - Updated `SubscriptionActor` to handle retry logic and track delivery attempts. - Added tests to verify retry policy functionality and behavior under various conditions.
- Updated `push_loop` method to accept a `max_concurrency` parameter, allowing for configurable concurrent HTTP dispatches per push subscription. - Modified `PushLoop` struct to store the `max_concurrency` value. - Adjusted the `run` function to utilize the `max_concurrency` setting, implementing a semaphore to manage concurrent tasks effectively. - Updated related code in `main.rs` and test helpers to reflect the new concurrency feature.
- Introduced `DeadLetterPolicy` struct to manage message forwarding after exceeding maximum delivery attempts. - Updated `SubscriptionManager` to validate dead letter topics during subscription creation. - Enhanced `SubscriptionActor` to handle message redirection to dead letter topics based on the configured policy. - Added parsing functionality for dead letter policies in the API. - Implemented tests to ensure correct behavior of dead letter policies, including handling nonexistent topics and message forwarding.
The old formula `time + (time % precision)` only produced correct results by coincidence at exact 50% boundaries (e.g. 50ms → 100ms). For most inputs it was wrong — e.g. 199ms rounded to 300ms instead of 200ms. Replaced with `div_ceil` for correct round-up-to-nearest- 100ms behavior. Also replaced `lazy_static` with `std::sync::LazyLock` for the EPOCH static.
Eliminate unnecessary allocations in the hot publish/pull paths: - Take ownership of PublishRequest instead of borrowing, avoiding a full clone of message data and attributes per published message - Share message Vec across subscriptions using Arc<[Arc<TopicMessage>]> instead of cloning the Vec for each subscription on fan-out - Increase actor mpsc channel buffers from 16 to 128 to reduce backpressure under concurrent load - Remove unnecessary ack_ids.clone() in acknowledge handler Add criterion benchmarks covering data structures, internal throughput, and concurrent gRPC publish/pull/ack flows. Measured improvements (gRPC concurrent benchmarks): - 16 concurrent clients publishing 256B: -7.4% - 4 concurrent clients publishing 1KB: -6.6% - 1 client publishing 64KB: -5.9% - Full publish+pull+ack pipeline with 1KB: -12.8%
luis-bernal
approved these changes
Apr 3, 2026
radyz
approved these changes
Apr 3, 2026
Add dead letter policy, retry policy, and OIDC token pass-through to supported features. Reorganize the limitations section to better reflect the current state of the project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #10 (thanks @jimmyhoran !)