Skip to content

docs: say how each transport defers a message and what that does to ordering - #217

Merged
iancooper merged 1 commit into
BrighterCommand:masterfrom
guilhermeappel:docs/208-defer-per-transport
Nov 7, 2026
Merged

iancooper merged 1 commit into
BrighterCommand:masterfrom
guilhermeappel:docs/208-defer-per-transport

Conversation

@guilhermeappel

Copy link
Copy Markdown
Contributor

Part of issue #208. This adds the table Ian suggested in PR #209 and changes the two sentences that say a defer always goes through a scheduler and always de-orders. I kept it to this one page, so the Requeue with Delay section of BrighterSchedulerSupport.md is still open and doesn't match the table yet. The note about a failed requeue is open too, and so are the SQS delay limits (15 minutes on send, 12 hours on requeue), which wait for PR BrighterCommand/Brighter#4723.

@calebkoy this doesn't touch your SQS paragraph in PR #209, and the two merge cleanly in either order. Yours is still the only place that says the group is blocked during the delay, so I left that out of the table. It doesn't have the BufferSize limit below, so it would need that once both are in. If you were already working on the table, tell me and I'll close this.

PostgreSQL, RocketMQ and GCP Pub/Sub have their own rows instead of going under All others because they don't use the scheduler. The nack section of this page already says the message stays on the channel for those three. Azure Service Bus has two rows because a topic subscription and a queue don't defer the same way.

The SQS row has a limit that the issue and PR #209 don't mention, and it's the only row I tested. On a defer, order within a group only holds when BufferSize is 1. With more, the consumer asks SQS for a batch, the channel keeps the batch in its local buffer, and a requeue doesn't clear that buffer, so the pump runs the rest of the group while the deferred message waits. I ran Reactor and Proactor on the AWS V4 consumer at the head of PR BrighterCommand/Brighter#4723 (0c3e9fb24), against Floci 1.5.19, three runs each, with three messages in one group, a handler that always defers and a 60 second delay, and read the dispatch counts after 8 seconds. With a buffer of 1, the first message ran and the other two didn't. With a buffer of 3, all three ran. I didn't run this on real AWS or on the V3 consumer. The FIFO tests in PR BrighterCommand/Brighter#4723 use the default of 1, so they don't cover it. I haven't opened a Brighter issue for it.

The other rows come from reading the code at BrighterCommand/Brighter@14850234f, not from running it. I didn't check the order on RocketMQ FIFO topics, GCP ordering keys or Azure Service Bus sessions, which is why the RocketMQ, GCP and topic subscription rows say "Not guaranteed". The All others row doesn't cover the MSSQL independent subscriber, which isn't in a release yet: it needs a scheduler that implements IAmAMessageRequeueSchedulerSync or IAmAMessageRequeueSchedulerAsync, and the in-memory one doesn't.

pagelint on this page, linkcheck and symbolcheck report nothing new. No code block changed, so I didn't run blockcheck.

Where each row comes from, at BrighterCommand/Brighter@14850234f:

Row Source
AWS SQS AWSSQS.V4/SqsMessageConsumer.cs:282 and :403, Paramore.Brighter/ChannelAsync.cs:176 and :208
RabbitMQ RMQ.Async/RmqMessageConsumer.cs:481, RMQ.Sync/RmqMessageConsumer.cs:381
Azure Service Bus AzureServiceBusConsumer.cs:389, AzureServiceBusConsumerFactory.cs:115, AzureServiceBusRequeueScheduler.cs:118
PostgreSQL PostgresMessageConsumer.cs:145 (read), :350 (defer)
RocketMQ RocketMessageConsumer.cs:205 and :213
GCP Pub/Sub GcpPullMessageConsumer.cs:500, GcpPubSubStreamMessageConsumer.cs:307, GcpPubSubMessageGateway.cs:375
Kafka, Redis, MQTT, MSSQL KafkaMessageConsumer.cs:746, RedisMessageConsumer.cs:462, MQTTMessageConsumer.cs:438, MsSqlMessageConsumer.cs:332, MsSqlMessageConsumerFactory.cs:82

…rdering

HandlerFailure.md said a defer goes through a scheduler and de-orders
the message, which isn't true on every transport. Ian suggested a table
in PR BrighterCommand#209, so the page now has one, and the two sentences that said so
point to it.

Part of issue BrighterCommand#208.
@calebkoy

calebkoy commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @guilhermeappel ❤️ That sounds like a good approach. I've pushed a commit to mine and tagged Ian suggesting that merge order

@iancooper
iancooper merged commit 1480784 into BrighterCommand:master Nov 7, 2026
6 checks passed
@guilhermeappel
guilhermeappel deleted the docs/208-defer-per-transport branch November 9, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants