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 to query afterwards.
// the queue moves work; the database keeps the record
DB::transaction(function () use ($order) {
$order->save();
Outbox::create(['topic' => 'order.placed', 'payload' => $order->toArray()]);
});
// a worker publishes from the outbox and marks it sent
The question that exposes this is “how many orders were placed last Tuesday” — if the only answer involves replaying a queue, the design has confused transport with storage. Keeping the event in a table and publishing from it also solves the dual-write problem, since the row and the business change commit together.