Lattice business event reconciliation
What it does. Publishes again the outbound Lattice business events whose publish failed, from the payload stored in the business event log, once they are 15 minutes old and up to 5 attempts each. Runs: automatically every hour as a background process, and only when such an event exists. Who looks after it: Integration operator (checks the log); Integration administrator (the events it cannot resend, and the on-demand sweep); System administrator (the background process itself, on a standard page).
Purpose
Some Lattice business events opt in to the Lattice business event log. When one of them fails to publish outside a database transaction, the failure does not stop the business process that raised it: Lattice writes an Error row with the error and the event's payload, and raises the Business event publish failed alert. The subscriber, though, never receives the event.
This process sends those events again, so a subscriber gets what it missed without anyone finding the row first. The replay carries the payload the failed publish had, with its original sequence number and correlation ID, so the subscriber can tell it is the same event.
Two events opt in today:
| Event | What this process does with it |
|---|---|
| Retail assortment published | Publishes it again from the stored payload |
| Business event publish failed (the alert itself) | Cannot resend it: marks the row Manual intervention required |
Other Lattice business events, and standard ones, are not written to this log, so this process never sees them.
When it runs
- Every hour. It is one process for the whole environment: it replays each event in the legal entity the event was raised in.
- 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 for at least one row the sweep would take (see How it works). With none, 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 business event reconciliation and choose Edit, then Repeat interval on the Execution parameters tab | Every hour |
| A time of day when it does not run | The same dialog, Sleep time period group | Not set by Lattice |
| Attempts per event | Maximum retries on the dialog of Business event reconciliation sweep, for a run you start yourself | 5 |
| How old a failure must be before the first attempt | Minimum age (minutes) on the same dialog | 15 minutes |
| Run the sweep now | System administration > Periodic tasks > Lattice business events > Business event reconciliation sweep, also the Business event reconciliation sweep button on Business event log | None |
The background process takes no parameters, so it always uses 5 attempts and 15 minutes. The Process automations page is a standard page that only the System administrator role opens. Business event reconciliation sweep needs the Integration administrator role and is refused while the license blocks Lattice; the background process is not stopped by the license.
How it works
- Collect the candidates: log rows with Business event log status Error, Reconciliation state Not reconciled, a Retry count below the maximum, and created more than 15 minutes ago.
- Switch to the row's legal entity. If that legal entity no longer exists, the current one is used.
- Check that the event can be replayed. An event with no replay support (the Business event publish failed alert) is marked Manual intervention required and is not tried again.
- Publish the event again from the stored payload. A Retail assortment published row with no payload is rebuilt from the assortment's current state instead, with a new sequence number and today's item list.
- Record the attempt on the same row: Retry count goes up by one and Last retry is set.
- Published: Reconciliation state becomes Resolved and Last replay error is cleared. The new publish is also logged as a separate Success row.
- Not published: the error goes into Last replay error and the row stays Not reconciled for the next run, or becomes Exhausted when Retry count reaches the maximum. A failed replay never adds a new Error row.
- Summarize with "Business event reconciliation: n re-published, n still pending, n exhausted, n need manual intervention."
The row keeps Business event log status Error whatever happens, so the original failure stays on record; read Reconciliation state for the outcome.
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.
- The business events framework is on, and the event is activated in the row's legal entity on the standard Business events catalog with a working endpoint. Otherwise every replay fails and the row ends Exhausted.
Inputs and outputs
| Reads | Changes or creates |
|---|---|
| Business event log rows that are Error and Not reconciled | Reconciliation state, Retry count, Last retry and Last replay error on each row |
| The stored payload of each row (or the assortment, when the row has none) | The business event, published again to its endpoints |
| A Success row in Business event log for each event it publishes |
Monitoring and logs
- System administration > Inquiries > Lattice business events > Business event log: Business event ID,
Legal entity, Business event log status, Status details (the original error), Reconciliation
state, Retry count, Last retry and Last replay error. All four Lattice integration roles can open
it. The read-only OData entity
LatticeBusinessEventLogsexposes the same rows without the stored payload. - The Unresolved business event errors tile on the Integration operations workspace counts the Error rows that are Not reconciled, Exhausted or Manual intervention required. An Integration administrator can Dismiss an Exhausted or Manual intervention required row on the business event log once it is dealt with: it becomes Dismissed, keeps its error and payload, leaves the tile, and this process skips it.
- Process automations, View most recent results: "Lattice business event reconciliation finished.", or "Lattice business event reconciliation failed. The messages below give the reason; the process runs again at its next interval." with the messages. A poll with nothing to do adds no result.
- System administration > Inquiries > Batch jobs: the jobs are named Lattice business event reconciliation.
When it fails
Each row is replayed and recorded on its own, so one failure never stops the run. A run that fails as a whole is recorded as failed in the process results and runs again at the next interval.
| Symptom | Cause | Fix |
|---|---|---|
| Last replay error: "Business event 'id' was not published again because the business events framework is off or the event is not activated in this legal entity." | The event was deactivated, or never activated, in the row's Legal entity | Activate it there. A row that is still Not reconciled is sent at the next run; an Exhausted one is not tried again, so send the event again from its source. |
| Last replay error: "The retail assortment published event can't be replayed: the log row stores no payload and assortment 'id' doesn't exist." | The row has no payload and the assortment was deleted | Nothing can be resent. Tell the subscriber, or publish the assortment again if it still matters. |
| Reconciliation state Manual intervention required | The row is a Business event publish failed alert, which has no replay support | Read Status details, then follow up the failed event the alert was about. Then Dismiss the row so it leaves the tile. |
| Reconciliation state Exhausted | Five replays failed | Fix the cause in Last replay error, then raise the event again from its source (for an assortment, publish it again). Then Dismiss the row so it leaves the tile. |
| Rows stay Not reconciled and Retry count stays at 0 | The process is not running: process automation is not initialized, or Lattice was deployed without the database synchronization that registers its processes | Initialize process automation, or deploy Lattice again through your build so the database synchronization runs; the rows are sent at the next run. |
Effect on the rest of Lattice
- A failure inside a database transaction rolls back with the business document and leaves no Error row, so this process does not see it.
- Each successful replay adds a Success row, and the business event log cleanup keeps every row that is still Not reconciled, whatever its age; finished rows are deleted after 90 days by the Lattice integration log cleanup.
- Do not also schedule Business event reconciliation sweep as a recurring batch job: the background process already covers the whole environment, and two sweeps running at the same time can each publish the same event again.