This is a salesforce connector that uses the Apex Microservices Open Specification (AMOS), particularly:
- the Service Summary inner class
- package agnostic event parameters
- instance configuration via custom setting
Instead of you polling another system for data... they knock on the door of your system.
We're not just standing up an Apex webservice class or a REST annotated method. A webhook shouldn't be concerned with performing any action. It should merely eat the notification so the transmitter can "fire and forget."
It separates the three concerns: the synchronous responder that says "got it!"; the event that is persisted; another service performs some action while having no knowledge of the webhook transport.
Rolling that Apex webhook probably won't be the first or the last one we ever build. We separate the event from the action by using AMOS with a service container. And the action gets free transaction management, free error handling, and context independence. Code less like the left, and more like the right:
- First is your webhook
- Second is your action (using AMOS)
On any service instance, click Configure to expose:
- URL path
- HTTP verbs
- Custom response