SShortSingh.
Back to feed

Node.js reminder queues: idempotent retries for at-least-once message delivery

0
·2 views

Duplicate user reminders usually mean the queue redelivered a message, so the design should assume at-least-once delivery from the start. The recommended approach is to persist a durable reminder send key before calling the email or SMS provider, then acknowledge the message only once that state is safe. A unique database constraint makes replays harmless, turning a duplicate into a no-op. The article compares Amazon SQS, Google Cloud Pub/Sub, BullMQ with Redis, and a managed REST queue, favoring a managed queue with a simple worker and an idempotency table for small Node.js products. It also warns that no queue setting can make a database write and a provider call atomic, so provider-side idempotency or reconciliation is still needed.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

OpenCode Warns 1.4% of Console Users to Rotate OpenAI and Anthropic Keys After Breach

OpenCode disclosed a security breach on October 17 affecting a legacy system it had been decommissioning. The company says third-party provider keys saved in Console workspaces, such as those for OpenAI and Anthropic, may have been exposed. Roughly 1.4% of Console users were affected, and OpenCode says it has emailed them and is working with Anthropic, OpenAI and Google on remediation. Affected users are advised to revoke and replace their keys, update applications, and check recent usage for unexpected activity. Key details, including how the attacker gained access and the number of compromised accounts, have not been disclosed.

0
ProgrammingDEV Community ·

Why AI Setup Architecture Matters More Than Model Choice, a FinOps Review

A developer with five years of AI work says the bottleneck in AI development is no longer model intelligence but how tools are structured. Using a single frontier model for every task led to context window abuse, rapid token depletion, and hours lost to manual setup. The author compares frontier models to race cars that should be reserved for specialized R&D rather than everyday work. For learning and project building, the piece recommends a compartmentalized stack prioritizing stability and deep context. It cites Google's $30 developer tier, including the cloud IDE Project IDX and large-context Gemini models, as an example of this separation.

0
ProgrammingDEV Community ·

Replay test finds 17 stable mismatches between API examples and live responses

A team checked whether the sample request-and-answer examples its paid endpoints publish actually match what the handlers return. They replayed 1,602 services over loopback and compared each real response against its advertised example. Of these, 1,444 matched, while 141 varied naturally and 8 were exempt timestamp fields. The 17 stable mismatches were mostly time-derived or upstream data that changes often, plus one genuine defect in a DNS endpoint that returned A records in inconsistent order. The fix was a small deterministic sorting step, verified by repeated calls producing identical bytes.

0
ProgrammingDEV Community ·

Mail forwarding rules can keep intruders collecting email after a password reset

Standard incident response of changing a password and revoking sessions does not remove mail forwarding rules that an intruder added to a compromised mailbox. Such rules are configuration settings rather than credentials, so they keep copying incoming messages to an attacker-controlled address after the password is replaced. The technique is catalogued by MITRE ATT&CK under email collection and appears frequently in intrusion reports. The article recommends that responders enumerate and remove forwarding rules, external delegates, and other automatic processing on affected mailboxes as a routine step. It also suggests monitoring for suspicious rules, such as external destinations or rules that delete or hide messages, and logging configuration changes alongside sign-in events.