Lattice dead-letter retry
What it does. Replays the dead-letter items that are due for another attempt, and closes re-queued file ingestion items once their record has been processed. Runs: automatically every 5 minutes as a background process, and only when an item is due. Who looks after it: Integration administrator (the dead-letter actions and the on-demand sweep); System administrator (the background process itself, on a standard page).
Purpose
When an asynchronous operation or a file ingestion record fails with an error that may pass (a record lock, a target that was briefly unavailable), Lattice puts it in the dead-letter queue as Retrying, due at once. This process replays it with the original request ID, so a request that in fact posted returns its recorded result instead of posting a second time. Temporary problems clear without anyone acting, and an item that keeps failing is parked for a person after 5 attempts, with the Integration item parked business event to tell your monitoring.
Without it, retryable failures stay Retrying forever: they are never replayed, never parked, and never raise the event. Re-queued file ingestion items stay Requeued even after their record has been processed.
When it runs
- Every 5 minutes. It is one process for the whole environment, not one per legal entity.
- The database synchronization of a Lattice deployment registers it, and process automation must be initialized in the environment. There is no batch job for you to create.
- Before it creates a batch job, each poll checks whether there is work: an item that is Retrying and whose Next retry has passed, or an item that is Requeued. With neither, no batch job is created.
Configuration and scheduling
| Setting | Where | Default |
|---|---|---|
| How often it runs | System administration > Setup > Process automations, Background processes tab: select Lattice dead-letter retry and choose Edit, then Repeat interval on the Execution parameters tab | Every 5 minutes |
| A time of day when it does not run | The same dialog, Sleep time period group | Not set by Lattice |
| The user it runs as | The same dialog, owner field on the Background process tab | The user the deployment's database synchronization ran as |
| Attempts per item | No setting; each item shows its Max attempts | 5 |
| Wait after a failed attempt | No setting | 1 minute after the first failed attempt, then 2, 4 and 8 minutes |
| Run the sweep now | System administration > Periodic tasks > Lattice > Run integration dead-letter retry sweep (no fields of its own) | None |
| Act on one item | Integration operations console: Retry now, Hold, Release, Discard | None |
Because the process looks for due items every 5 minutes, each retry happens at the first poll after its wait has passed. A longer interval delays every retry further.
The Process automations page is a standard page that only the System administrator role opens. Run integration dead-letter retry sweep, Retry now, Hold and Release need the Integration operator or administrator role, and Discard needs the Integration administrator role; the sweep from the menu is refused while the license blocks Lattice.
Retry now makes a Parked or Retrying item due at once. It does not reset Attempts, so a parked item that has used its attempts gets one more try and is parked again if that fails. Hold takes an item out of the retries until Release makes it due again.
How it works
- Close finished re-queued items. Each Requeued file ingestion item whose record has since been processed, or no longer exists, becomes Reprocessed.
- Recover interrupted asynchronous operations, the same recovery the Lattice Async Operation Processing process runs every minute.
- Check the license. If it blocks Lattice processing, stop with the message "Run integration dead-letter retry sweep did not run because the license blocks Lattice processing (status status). The waiting work runs after the license is restored." The due items stay due and use none of their attempts.
- List the due items: Retrying with Next retry passed. Held and Parked items are not touched.
- Replay each item, one at a time, with its original request ID and its stored payload (the corrected payload
when an administrator edited one on Dead-letter fix and resubmit):
- Async operation: the operation runs again. It must still be enabled on Async operation registry, and
the user the process runs as must hold access to it, as for a direct call. On success the item becomes
Reprocessed and the async operation becomes Succeeded with the posted document. A payload that sets
PreviewModetotrueis only previewed and posts nothing, so the item is Parked at once, whether the preview passed or failed: its Failure message says "Dead-letter ... was replayed as a preview, because its payload sets PreviewMode to true. ...". SetPreviewModetofalse(or remove it) and resubmit to post it. - File ingestion: the record is put back in its queue as Queued with its processing attempts reset, and the item becomes Requeued. The next run of Process file ingestion segments processes it; step 1 of a later run then closes the item, or a new failure of the record reopens it.
- Async operation: the operation runs again. It must still be enabled on Async operation registry, and
the user the process runs as must hold access to it, as for a direct call. On success the item becomes
Reprocessed and the async operation becomes Succeeded with the posted document. A payload that sets
- Record a failed replay. Attempts goes up by one. When it reaches Max attempts, the item becomes Parked, the run writes the warning "Dead-letter id (source service.operation) exhausted 5 retries and was parked for manual review.", and the Integration item parked business event is raised. Otherwise Next retry moves on by the wait.
- Summarize with "Dead-letter retry sweep completed. Reprocessed: n, rescheduled: n, parked: n."
Before it can run
- Process automation is initialized in the environment (System administration > Setup > Initialize process automations), and Lattice was deployed with a database synchronization, which registers the process.
- A batch server is running, and the Lattice license does not block processing.
- For asynchronous operations: the user the process runs as holds access to the operations it replays (by default the user the deployment ran as, usually an administrator), and each operation is still enabled on Async operation registry.
- For file ingestion records: Process file ingestion segments is scheduled, or a re-queued record is never processed. See I want to schedule the Lattice jobs that are not background processes.
- For alerts: the Integration item parked business event is activated, as in I want to activate a business event and send it to an endpoint.
Inputs and outputs
| Reads | Changes or creates |
|---|---|
| Dead-letter items: Retrying and due, and Requeued | The item's Status (Reprocessed, Requeued, Parked), Attempts, Next retry and Last attempt |
| The stored payload and request ID of each item | The documents the replayed operation posts, under the original request ID |
| The file ingestion record of each Requeued item | The async operation of a replayed item (Succeeded), and the file ingestion record of a replayed item (Queued) |
| The Integration item parked business event for each item it parks, when the event is activated |
Monitoring and logs
- The Dead letters awaiting action tile on the Integration operations and File ingestion operations workspaces counts the items that are Retrying, Parked or Held, and opens Integration operations console filtered to them. The console shows Queue status and, per item, Status, Attempts, First failed and Next retry.
- Inbound message inquiry, Dead letter tab, adds Max attempts, Last attempt and Failure message.
- The
LatticeIntegrationDeadLettersentity for all four Lattice integration roles; the payloads are inLatticeIntegrationDeadLetterPayloads, for the Integration administrator only. - Process automations, View most recent results on the process: "Lattice dead-letter retry finished.", or "Lattice dead-letter retry failed. The messages below give the reason; the process runs again at its next interval." with the messages of the failed run. A poll with nothing to do adds no result.
- System administration > Inquiries > Batch jobs: the jobs are named Lattice dead-letter retry.
- When Application Insights telemetry is set up:
Lattice.Dlq.Reprocessed,Lattice.Dlq.RetryScheduledandLattice.Dlq.Parkedfor each item (ids, codes and counts, never the payload or the failure message).
Reprocessed and Discarded items are deleted 90 days after their last attempt by the Lattice integration log cleanup.
When it fails
Each item is replayed and recorded on its own, so one item's failure never stops the rest of the run. A replay that raises an error writes "Replay of dead-letter id raised an error; it will be rescheduled or parked." and counts as a failed attempt. If the outcome cannot be saved, the run writes "Failed to record the retry outcome for dead-letter id." and the item is tried again at the next run. If raising the parked event fails, the run writes "Failed to raise the integration failure business event for dead-letter id." and the item stays parked. A run that fails as a whole is recorded as failed in the process results and runs again at the next interval; it is not retried in between.
| Symptom | Cause | Fix |
|---|---|---|
| Items stay Retrying long after their Next retry | The process is not running: process automation is not initialized, or Lattice was deployed without the database synchronization that registers its processes; or the license blocks Lattice | Initialize process automation, deploy Lattice again through your build so the database synchronization runs, or restore the license; the due items are replayed at the next poll. |
| Asynchronous items fail every automatic retry and are parked, yet the same item succeeds when an administrator resubmits it | The user the process runs as has no access to the target operation, or the operation was switched off on Async operation registry | Give the process owner a role that grants the operation, or change the owner (both System administrator work), or enable the operation again, then choose Retry now. |
| File ingestion items stay Requeued | Process file ingestion segments is not scheduled | Schedule it; the next dead-letter retry after the record is processed closes the item. |
| An item is Parked at once, with no retries | The failure cannot pass by itself (for example a payload that cannot be read, a disabled operation, or no access), or the payload sets PreviewMode to true, so the replay was only a preview | Fix the cause, then use Fix and resubmit on Dead-letter fix and resubmit, or Retry now. |
| Items are parked but your monitoring hears nothing | Integration item parked is not activated, or has no endpoint | Activate the event and bind it to an endpoint. |
Effect on the rest of Lattice
- The Integration item parked business event depends on this process for every retryable failure: those items reach Parked, and raise the event, only through it.
- A successful replay of an asynchronous operation also closes its async operation as Succeeded, so a caller
polling
getAsyncOperationStatussees the real outcome. - Each replay of an asynchronous operation runs the target operation again on the batch server, as the user the process runs as; a replayed file ingestion record waits for the next run of Process file ingestion segments.
- Do not also schedule Run integration dead-letter retry sweep as a recurring batch job: two sweeps would work the same due items at the same time. The original request ID keeps an item from posting twice, but the runs compete and count attempts against each other.
Related
- I want to see what is in the dead-letter queue and why
- I want to retry, hold, release or discard a dead-lettered message
- I want to fix a bad payload and resubmit it
- I want to act on an item an operator hands over
- I want to read a failed request and its payload from the dead-letter queue
- Respond to a failed integration
- Recovering a failed integration message and Dead-letter status
- Integration item parked
- Lattice Async Operation Processing