
How to Subscribe to Salesforce Platform Events with Mule 4
- Subscribe to Platform Events. Follow below steps to develop a mule flow to subscribe to Salesforce Platform events with Mule 4.
- Subscribe Channel Listener. Step 3: Now add Transform message to extract the event message that is encapsulated in the above Object.
- Replay Channel Listener. You can also use Replay channel listener operation to subscribe to Salesforce Platform events. ...
- Conclusion. We hope this article helped you to learn how to subscribe to Salesforce platform events with Mule 4.
How do I subscribe to apex events in Salesforce?
With platform events, the process is similar. You simply write an after insert Apex trigger on the event object to subscribe to incoming events. Triggers provide an autosubscription mechanism in Apex. No need to explicitly create and listen to a channel.
How do I create a platform event in Salesforce?
To create a platform event trigger, use the Developer Console. Click the Setup icon, select Developer Console, and click File | New | Apex Trigger. Provide a name and choose your event for the sObject, and click Submit. The Developer Console automatically adds the after insert event in the trigger template.
How to subscribe to Salesforce Platform events with mule 4?
Follow below steps to develop a mule flow to subscribe to Salesforce Platform events with Mule 4. Step 1: Add Salesforce Subscribe channel listener and configure as shown below: Step 2: Log the actual platform event which will be in the Object format like below:
How to extract event message from Salesforce subscribe channel listener?
Step 1: Add Salesforce Subscribe channel listener and configure as shown below: Step 2: Log the actual platform event which will be in the Object format like below: The sample event would look like: Step 3: Now add Transform message to extract the event message that is encapsulated in the above Object.

How do I subscribe to a Salesforce event?
Subscribe to Platform Event Notifications with Apex TriggersClick the Setup icon, select Developer Console, and click File | New | Apex Trigger.Provide a name and choose your event for the sObject, and click Submit.
How do I view platform events in Salesforce?
View Event Subscribers From Setup, enter Platform Events in the Quick Find box, then select Platform Events. Click your event's name. On the event's definition page, the Subscriptions related list shows all the active triggers, processes, and platform event–triggered flows that are subscribed to the platform event.
What is Salesforce platform event?
Salesforce publishes standard platform events in response to an action that occurred in the org or to report errors. For example, LoginEventStream monitors user login activity and BatchApexErrorEvent reports errors encountered in batch Apex jobs.
How do I send a platform event in Salesforce?
Use Apex to publish event messages from a Salesforce app. External apps use an API to publish platform event messages. Use Pub/Sub API to publish platform event messages from an external app and get final publish results. Simplify your development by using one API to publish, subscribe, and retrieve the event schema.
How do I subscribe to a platform event in workbench?
Subscribing to Platform Event via WorkbenchLogin to wokbench.developerforce.com.Navigate to Streaming Push Topics under Queries.Select Generic Subscriptions.Fill the Subscription field in the format /event/{EVENT_NAME}In the above example, it should be /event/Test_Event__e.Click the subscribe button.
Can I query platform event Salesforce?
Considerations :- You can not query Platform events through SOQL or SOSL. Published platform events can't be rolled back.
How do I give access to a platform event?
To subscribe to or publish messages to Salesforce custom platform events, you must configure permissions in your Salesforce environment.Log in to Salesforce.Under. Administer. on the left pane, click. Manage Users. ... Edit the profile to assign object permissions to the Salesforce custom platform event that you created.
How do you use a platform event?
Define a Platform EventFrom Setup, enter Platform Events in the Quick Find box, then select Platform Events.On the Platform Events page, click New Platform Event.Create a Notification platform event with the following settings: Label: Notification. Plural Label: Notifications. Object Name: Notification. ... Click Save.
What is platform event message in Salesforce?
A platform event is a special kind of Salesforce entity, similar in many ways to an sObject. An event message is an instance of a platform event, similar to how a record is an instance of a custom object. Unlike custom objects, you can't update or delete event records.
How does Salesforce work?
Your Salesforce app uses a trigger to listen to events. Once your app receives the notification from the order system through the trigger, it creates a task to follow up on the order shipment.
What is cometd in Visualforce?
CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeux protocol. Long polling, also called Comet programming, allows emulation of an information push from a server to a client. Similar to a normal poll, the client connects and requests information from the server. However, instead of sending an empty response if information isn't available, the server holds the request and waits until information is available (an event occurs).
Subscribe in a Lightning Web Component
To use the empApi methods in your Lightning web component, import the methods from the lightning/empApi module as follows.
Subscribe in an Aura Component
To use the empApi methods in your Aura component, add the lightning:empApi component inside your custom component and assign an aura:id attribute to it.
Subscribe to Platform Events
Follow below steps to develop a mule flow to subscribe to Salesforce Platform events with Mule 4.
Subscribe Channel Listener
Step 1: Add Salesforce Subscribe channel listener and configure as shown below:
Replay Channel Listener
You can also use Replay channel listener operation to subscribe to Salesforce Platform events. You can subscribe events based on Replay conditions such as ALL, ONLY_NEW and FROM_REPLAY_ID .
Conclusion
We hope this article helped you to learn how to subscribe to Salesforce platform events with Mule 4.
