For an integration with Salesforce, I am using AWS Appflow and subsequently AWS Eventbridge to process certain change events in Salesforce. I have set up an AppFlow integration in AWS (as explained here), which processes the change event that is fired from Salesforce (managed by Change Data Capture in the Service Setup for the sandbox environment I am using for my development).
This works most of the time, mostly when events are fired from Salesforce in quick succession. But every Monday when I continue working, the first change event that I fire from Salesforce results in the flow in AWS Appflow to go in a suspended mode, with the following error message:
The flow has been suspended due to an error in Salesforce when subscribing to the event. Here’s the detailed error message: Subscribing to topic /data/CampaignMemberChangeEvent with replayId 2439164 failed due to com.amazon.sandstonebridge.connector.exception.ClientSubscriptionException: Cannot subscribe to topic /data/CampaignMemberChangeEvent, replay from 2439164, with error 400::The replayId {2439164} you provided was invalid. Please provide a valid ID, -2 to replay all events, or -1 to replay only new events. (Service: null; Status Code: 0; Error Code: Client; Request ID: 178064294592-99b135d10837cfc986a09b40456def8b; Proxy: null)
After doing some research into Replay Events, (and correct me if i'm wrong) they seem to be needed when you want to replay an event in Salesforce that has happened in the past. But, my use case is just to fetch the current change event, not any event that might have happened before the weekend. I am confused to why Appflow goes into a suspended state, the moment I do a Change Event after the weekend. I just need that new change event, and not let Appflow go into suspended mode because it tries to replay old events that lie outside the replay time window.
How can I prevent AWS Appflow from going into a suspended state?