SShortSingh.
Back to feed

Multi-Pod Spring Boot Job Queues: Avoiding Duplicate Work with Postgres SKIP LOCKED

0
·2 views

A support team found a customer receiving the same invoice email three times, traced to three scaled-out pods each processing the same batch from one notification table. Because @Scheduled runs independently in every JVM and a plain SELECT takes no row locks under PostgreSQL's default isolation, all pods read identical pending rows and send duplicate emails. Adding a pessimistic lock prevents duplicates but serializes the pods, so the extra replicas add no throughput. The article points to SELECT ... FOR UPDATE SKIP LOCKED as a way for workers to claim disjoint rows, while cautioning about trade-offs such as inconsistent views and crashed-worker recovery.

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 ·

Ephemeral webhook receiver aims to ease debugging of integration payloads

A developer found that webhook integration bugs, such as a parser failing on an unexpected field, were often hard to diagnose during testing. Public webhook inspectors seemed unsuitable for payloads containing tokens in headers, so they built a disposable receiver. Each request creates a single-use HTTPS URL that captures incoming events for up to 24 hours, storing up to 100 in memory and deleting them on expiry. A key limitation is that a process restart clears pending events, which caused the developer to lose a test batch. The developer now polls aggressively and treats each URL as disposable, and has packaged the tool as a web resource.

0
ProgrammingDEV Community ·

Hetzner Unpaid Invoices: Common Causes and Steps to Resolve Them

A Hetzner unpaid invoice means the billing system has not recorded a successful payment for a period by its due date. Typical causes include a failed card charge, an expired card or direct-debit mandate, a bank transfer missing the customer number, or a removed payment method. An unpaid invoice does not automatically close an account, but it calls for prompt action, since Hetzner usually escalates through reminders before restricting services. Users are advised to confirm the outstanding invoice in their console, check the payment method and transfer references, and back up data while access remains. Settling the balance and fixing the payment method in the same session helps prevent a repeat failure.

0
ProgrammingDEV Community ·

What $60,000 a Year Actually Takes Home After Taxes in 2026

A $60,000 salary does not translate directly into take-home pay, as federal income tax, Social Security, Medicare, state taxes and benefit deductions are withheld first. Using 2026 IRS and Social Security figures, a single filer taking the standard deduction in a state with no income tax would keep about $50,390 a year after federal taxes and FICA. The estimate assumes no other income, credits or pre-tax deductions, and per-paycheck amounts vary by pay schedule. Residents of states with income taxes, or whose benefits reduce pay, would see lower net amounts. The author notes the figures are estimates rather than tax advice, and actual results depend on filing status, Form W-4 elections and local rules.

0
ProgrammingDEV Community ·

AI in API Regression Testing: Generating, Maintaining, and Explaining Tests

Most published rankings of AI regression testing tools focus on user interface testing, which fits visual problems but overlooks API regressions that often leave responses looking normal. API breakages are subtler, such as a field changing type or an optional value vanishing, so AI in these tools must reason about meaning rather than pixels. Typically the AI performs one or more of three jobs: generating test cases, maintaining tests as APIs change, or explaining failed runs in plain language. The inputs used for generation matter greatly, since API specifications offer broad coverage but may describe intended behavior that differs from reality, while recorded traffic reflects actual usage but can miss rarely called endpoints. Readers should therefore evaluate tools by which of these functions they need, rather than by how prominently they advertise AI.