nats.rs
nats.rs copied to clipboard
Optimize JetStream Pull consumer to use max bytes instead of pending messages
Use Case:
Pull Consumers optimed (consumer.messages()
) and customizable (consumer.stream()
) modes should use max_bytes
as a way of optimizing throughput, as a more meaningful way of throttling messages.
Proposed Change:
prioritize max_bytes over pending messages when deciding to send or not the next fetch request.
Who Benefits From The Change(s)?
both users utilizing default use case and the more advanced once, tweaking the setup.
Alternative Approaches
rely on current behaviour.