top of page

Publishing & Subscribing to Platform Events

Lightning component uses empApi component to subscribe and receive event messages.


External clients can subscribe to events using CometD.

A custom CometD client can be implemented or Emp Connector can be used.

Platform events are sent by Salesforce to CometD clients sequentially in the order they are received.

Use case:

Events could be published from a Heroku application (via the REST API) or from a trigger on Chatter posts (via Apex). They should be received by a Lightning console app that should act as a subscriber (via the lightning:empApi component that uses a CometD client connection).

Solution Design:


For implementation details refer to https://github.com/JohnsonTitus/auraPubSubEvent.git


Use case:

When a sales order is created on an external web application, Salesforce user has to be notified and custom object record should be created.

Solution:

Using platform event, the external web app can publish it by using one of Salesforce's API - SOAP or REST or Bulk API.

Salesforce can subscribe to it using trigger on platform event object or process builder.

Recent Posts

See All
Use cases for Aura components

Accordion: Similar to menu items, clicking on an item displays its content. You can embed html tags or components in it. Check the link...

 
 
 
Use of helper in Aura

Put functions that you want to reuse in the component’s helper. Helper functions also enable specialization of tasks, such as...

 
 
 
Events in Aura

Application Event An application event is fired from an instance of a component. All components that provide a handler for the...

 
 
 

Comments


Post: Blog2_Post

©2020 by SalesforceDemystified. Proudly created with Wix.com

bottom of page