EnSync Engine Documentation Help

DISCARD Command

Syntax

DISCARD;CLIENT_ID=client_id;EVENT_NAME=event_type;EVENT_IDEM=unique_id;REASON=discard_reason

Parameters

Parameter

Description

Required

Example

CLIENT_ID

ID of the client discarding the event

Yes

client-123abc

EVENT_NAME

Type of event being discarded

Yes

user/profile/updated

EVENT_IDEM

Unique ID of the event to discard

Yes

evt_12345abcde

REASON

Reason for discarding the event

Yes

Duplicate event

Response

Success

+PASS:DISCARDED;IDEM=evt_12345abcde

The response includes the ID of the discarded event.

Error

-FAIL:MISSING_PARAMETERS;MESSAGE=Missing required discard data. Ensure CLIENT_ID, EVENT_NAME, and EVENT_IDEM are passed
-FAIL:MISSING_REASON;MESSAGE=REASON is required for DISCARD command
-FAIL:NOT_FOUND;MESSAGE=Event not found in processing queue

Examples

Basic Discard

DISCARD;CLIENT_ID=client-123abc;EVENT_NAME=user/profile/updated;EVENT_IDEM=evt_12345abcde;REASON=Duplicate event

Discard Invalid Event

DISCARD;CLIENT_ID=client-123abc;EVENT_NAME=payment/process;EVENT_IDEM=evt_12345abcde;REASON=Invalid payment data

Notes

  • Discarded events are permanently removed and cannot be recovered

  • The REASON parameter is mandatory to ensure proper documentation of why an event was discarded

  • Only the client that is currently processing an event can discard it

  • Discarding should be used for events that should never be processed (e.g., duplicates, invalid data)

  • The system logs all discarded events for audit purposes

  • Unlike the DEFER command which postpones processing, DISCARD permanently removes the event

Last modified: 07 October 2025