What happens to a message nothing can read¶
A message arrives on a queue and no format in Settings.Reads can make an event of it. The adapter
does not hand the handler an empty or partial event. It never becomes a Delivery. This is
spec 0015,
and the core's side of it is in the backend contract.
It covers three cases:
- unclaimed: no format claims it. A body with no CloudEvents attributes is one;
- ambiguous: two formats both claim it. The reader refuses to guess between them;
- malformed: a format claims it and cannot decode it.
What the adapter does¶
The adapter reads the message first, at the receive. If the read fails it:
- adds one to
Unreadable; - logs a warning with the subscription, the queue and the reason;
- settles the message the way the mode settles every message.
| Mode | Settlement |
|---|---|
AtLeastOnce |
released at once, with a visibility of zero. It is received again immediately, spends its receives quickly, and the queue's redrive policy moves it to the dead-letter queue when they run out |
AtMostOnce |
deleted, or it would come back |
It is never counted Accepted, because it never entered the queue the source hands from, and never
Exhausted, because the bus never offered it. Accepted is counted where a message enters that queue,
after the read. A message whose at-most-once delete failed is not counted Accepted either.
If the settling call itself fails, the adapter logs it and leaves the message for its visibility timeout. It is not retried by the adapter, and it comes back when the timeout lapses.
Why there is no delay¶
The release is with a visibility of zero, and a subscription's Backoff does not apply to it. A
Backoff delays a decline, and nobody declined this message: no handler saw it. The only thing left
to do with it is spend its receives, and the redrive policy dead-letters it when they run out.
Each receive is an attempt, so Unreadable counts attempts: one message on a queue with a
maxReceiveCount of five adds five. The tutorial run that publishes not an event shows it.
What it is not¶
It is not a handler failure. Exhausted and Errors stay where they were, and Unreadable is how an
operator tells a format mismatch from a handler that keeps failing.
It is not lost under AtLeastOnce: it is on the dead-letter queue. It is lost under AtMostOnce,
which is what the mode says about every message.
For finding them, see Watch for unreadable messages.