1

I have a Salesforce ISV app that shares some data with its Heroku-based backend.

To notify the backend about data changes in Salesforce we use Change Data Capture. For synching back changes from Heroku to Salesforce we use Custom Platform Events.

So far so good. The problem is the CDC-path is effortless and very flexible. If we change the data model the channel magically adapts. But for the way back we need to change the fields of the custom event and adjust code to synchronize it.

My question is, is there a better way to solve this? Like Change Data Capture in both directions.

2

Several alternatives...

REST API

Just update the data. You clearly already have a session ID if you can post events, so why not just call the REST API and cut out the middleman?

JSON

Create a large field on your event, send a JSON payload through the Platform Event. Deserialize in your Platform Event Trigger, and do whatever post-processing you need to.

| improve this answer | |
  • Can't the external Heroku app send CDC events into Salesforce? So that my CDC Apex triggers could just ask where the changes come from and then applies it or not? – Robert Sösemann Feb 6 at 14:41
  • 1
    @RobertSösemann CDC is basically a standard Platform Event generated by the platform. As far as I can tell, only Salesforce can generate these events, hence the need for a custom Platform Event if you want ESB-like functionality. – sfdcfox Feb 6 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.