fix(macros): aplicar retry/DLQ declarados em #[subscriber] no EventRouter#14
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(macros): aplicar retry/DLQ declarados em #[subscriber] no EventRouter#14cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
O register() só emitia constantes RETRY_* / DLQ_QUEUE; attach ignorava os atributos. Agora encadeia with_retry / with_dlq conforme exponential e dlq. Testes de integração em macros_sqs_dlq; trybuild stderr alinhado ao rustc 1.98. CHANGELOG: nota sobre SqsBroker sink-only e publish na DLQ. 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
Os atributos
retry = exponential(...)edlq = "..."em#[subscriber]eram documentados (CHANGELOG US-008) e expostos como constantes (RETRY_MAX_ATTEMPTS, etc.), mas o métodoregister()não encadeavaEventRouter::with_retry/with_dlq. Na prática,EventRouter::attachsó via política quando o utilizador repetia a configuração no builder fluente — quem confiava só na macro ficava sem retentativas in-process e sem DLQ via router, com comportamento diferente do anunciado (mensagens falhavam na primeira tentativa e não seguiam o caminho de DLQ dowrap_with_retry).Causa raiz
O codegen de
register()terminava emsubscribe/subscribe_publishsem propagarretry/dlqdoSubscriberAttrpara as inscrições queattachconsome.Correção
serverust-macros, apóssubscribe*, emitir sufixo que encadeia.with_retry(RetryPolicy::exponential(...))(e.dead_letter(#dlq)quando aplicável) ou apenas.with_dlq(#dlq)quando só há DLQ.serverust-events/tests/macros_sqs_dlq.rs(InMemoryBroker).trybuild: atualizarfail_fifo_producer_missing_group_id.stderrpara o formato de nota do rustc 1.98.Broker::publishna DLQ do router não funciona comSqsBrokersink-only (usarDlqLayerou DLQ na fila AWS).Validação
cargo +nightly test -p serverust-events --test macros_sqs_dlq --features in-memory,sqscargo +nightly test -p serverust-macros --test trybuildcargo +nightly check --workspace