fix(macros): aplicar retry/dlq declarados em #[subscriber] ao EventRouter#10
Closed
cursor[bot] wants to merge 1 commit into
Closed
fix(macros): aplicar retry/dlq declarados em #[subscriber] ao EventRouter#10cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
O parser já aceitava retry = exponential(...) e dlq = "...", mas o código gerado em register() só fazia subscribe/subscribe_publish — as políticas nunca eram ligadas ao router. Falhas não eram retentadas nem enviadas à DLQ conforme documentado. - Rastrear retry_specified para distinguir default de retry explícito - Encadear with_retry / with_dlq / dead_letter na última inscrição - Testes de introspecção no router (retry-only, dlq-only, ambos) Co-authored-by: Jaime Basso <JaimeJunr@users.noreply.github.com>
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.
Bug e impacto
#[subscriber(..., retry = exponential(...), dlq = "...")]parseava os atributos e expunha constantes (RETRY_MAX_ATTEMPTS, etc.), mas o métodoregister()não encadeavaEventRouter::with_retry/with_dlq. Em runtime, falhas de handler não eram retentadas nem publicadas na DLQ conforme documentado (US-008 / CHANGELOG), o que pode levar a perda de processamento esperado (mensagens indo para DLQ) ou ausência de backoff.Causa raiz
O
register_bodyda macro emitia apenassubscribe_with/subscribe_publish, sem pós-processamento que aplica as políticas à última inscrição do router.Correção
retry_specifiedemSubscriberAttr(distinto do defaultmax=1/base=0).subscriber_router_post_chainque emitewith_retry(RetryPolicy::exponential(...).dead_letter(...))e/ouwith_dlq(...)conforme o atributo.macros_sqs_dlq.rsvalidandolast_retry()/last_dlq()no router apósregister().Validação