Replies: 3 comments 17 replies
-
For the time being, is it possible and would it make sense to effectively 'turn off' any sort of outbox with Brighter in it's current state? We understand we'd potentially be trading off throughput but gaining our preference to not unknowingly drop messages. |
Beta Was this translation helpful? Give feedback.
-
Sending a message in Brighter involves two steps:
PostAsync does DepositPost followed by ClearAsync on the list of saved messages, and does not participate in your transaction.
Yes
Yep. In distributed systems in order for you to have guaranteed delivery, you must accept the possibility of duplicates. This is why we refer to guaranteed, at least once. The only way to get guaranteed, exactly once is to de-duplicate at the consumer side. Kafka has some support for that, but we also offer an Inbox which will allow you to reject a message that you have already successfully handled. This is a known limitation of distributed systems.
@preardon Any thoughts on this idea? Something you have seen? |
Beta Was this translation helpful? Give feedback.
-
@jtsalva ^^^ |
Beta Was this translation helpful? Give feedback.
-
@iancooper please could you help us validate more issues we're anticipating in situations with:
Our current understanding
During
PostAsync
the following happens:CheckOutstandingMessages
and during the sweeper process:
Potential Issue
Race condition we're concerned with are:
PostAsync
on messageA
A
A
as outstandingA
is published twiceSince an attempt to clear the outbox will be made by both sweepers which each Brighter process will have and as part of every
PostAsync
this would lead to a number of duplicate messages being published proportionate to the rate of messages being published and the number of sweeper processes competing against each other.Potential Solution
Assuming our understanding is correct, we're thinking it may make sense to implement a kind of 'visibility timeout'? So during
DynamoDbOutbox.OutstandingMessages
we would query for:Where we also update the visibility timeout again inside of
DynamoDbOutbox.OutstandingMessages
to benow + {ConfiguredVisibilityTimeout}
.Wouldn't be perfect as there's no consistent reads for the GSI but would help mitigate those race conditions.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions