This Trailhead Project uses cometd to display platform events in Lightning components.

Are there any alternatives I could use to subscribe to platform events in lightning components?

  • Where are you planning to use this component? in lightning communities? lightning experience? (both?) and what is your use case?
    – glls
    Jul 11, 2017 at 12:30
  • The trailhead example disturbes me. An auraEnable function that returns a sessionID token in Lightning context is not supposed to work.
    – Simonp
    Jul 17, 2017 at 20:58
  • @SimonPlacentino I was under the same impression about the SessionID. But I cannot remember where I picked that up. Jul 18, 2017 at 7:25
  • @glls In my case it is for Lightning Experience. I want to build some charts around platform events in LEX. I found cometd to be quite verbose and was looking for more succinct ways to get the job down. Jul 18, 2017 at 7:25
  • 1
    @ChristianSzandorKnapp Here was my workaround by loading a VFPage salesforce.stackexchange.com/questions/110515/…
    – Simonp
    Jul 18, 2017 at 9:52

1 Answer 1


My understanding is the only ways to monitor Platform events (as at Summer '17) is either via the Bayeux messaging protocol with cometd or via Apex triggers subscribed to the events.

In the Dreamforce 2016 Force.com and Heroku: Building a Connected System Through Platform Events there was a point on the Roadmap about "Additional messaging protocols" being supported. I heard the following from the youtube video and adjusted based on Google results - AMQP, MQTT, STOMP. enter image description here

However, fast forward to TrailheaDx 2017 with Event Driven Architectures with Platform Events and it no longer shows up on the roadmap.

enter image description here

So, right now I think if falls into the forward looking statements category.

If you have a request for a specific messaging protocol or something more directly integrated with lightning, bring it up in the dedicated Official: Platform Events Chatter group or on ideas.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .