Skip to content

Commit

Permalink
no need to loadEnvelope of replayed
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw committed Nov 29, 2024
1 parent 3e0425e commit 362e543
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,19 +598,17 @@ private[projection] object DynamoDBProjectionImpl {
import DynamoDBOffsetStore.Validation._
offsetStore
.validate(envelope)
.flatMap {
.map {
case Accepted =>
if (isFilteredEvent(envelope) && settings.warnAboutFilteredEventsInFlow) {
log.info(
"atLeastOnceFlow doesn't support skipping envelopes. Envelope [{}] still emitted.",
envelope)
}
loadEnvelope(envelope.asInstanceOf[Envelope], sourceProvider).map { loadedEnvelope =>
offsetStore.addInflight(loadedEnvelope)
Some(loadedEnvelope)
}
offsetStore.addInflight(envelope)
Some(envelope.asInstanceOf[Envelope])
case Duplicate =>
Future.successful(None)
None
case RejectedSeqNr =>
// this shouldn't happen
throw new RejectedEnvelope(
Expand Down

0 comments on commit 362e543

Please sign in to comment.