queues

  • A queue is not a database and will not keep your history

    A message is delivered, acknowledged and gone. Treating the queue as a record of what happened means the record disappears as it is processed, and there is nothing…

  • Publisher confirms, or the message was never sent

    basic_publish returns as soon as the message is written to the socket. The broker may not have accepted it, may not have routed it anywhere, and may have…

  • withoutOverlapping on a scheduled command

    A scheduled task that occasionally runs longer than its interval will be started again while the first is still going, which for an import means two processes writing…

  • A topic exchange is a routing decision you can change later

    Publishing directly to a queue name binds the producer to the consumer topology, so adding a second consumer means changing the publisher. A topic exchange puts a routing…

  • An event-driven seam between two services

    The synchronous call between two services was the reason both were down. Publishing an event decouples their availability — and makes eventual consistency a business decision.

  • Queue retry_after and the job that runs twice

    The queue worker’s –timeout and the connection’s retry_after are two different clocks, and getting their order wrong is the most common cause of a job silently running twice.…

  • Laravel 5.5 and the packages that install themselves

    The first release where installing a package is one command. Auto-discovery removes two config edits per package, and hides the fact that they happened.

  • The DEL that blocked the server, and UNLINK

    A 400ms pause on every request, once an hour, caused by a cache cleanup nobody thought of as expensive. Redis is single-threaded, and freeing memory is work.

  • The cron event that schedules itself twice

    wp_schedule_event() does not check whether the hook is already scheduled, so calling it on init — which is where it usually ends up — adds another entry on…

  • Queues, workers and the jobs that fail twice

    The email that arrived four times and the charge that arrived twice. What makes a job safe to run again, and keeping workers alive without them serving stale…