3

I have a simple Platform Event defined in several of our orgs (sandboxes), but in one of them, they just refuse to work.

As a test, I set up an Apex trigger subscriber to the event, made sure it's active, put a bunch of debugs in there so that I know when it gets called.

I can publish the event in Developer Console anonymous Apex and get no errors, but the Apex trigger subscriber never fires (I have another subscriber which is a Lightning Component using CometD and it doesn't received them either).

I can run the exact same test in other orgs without problems, but in this one org, it looks like Platform Events and/or the Event Bus just doesn't work. There are no errors, it just doesn't look like events are getting published.

The event is in deployed status, the trigger is active, I've double and triple checked everything I can think of, but it just doesn't work.

Has anybody run into this before? Any ideas on how to kickstart events working in this one org?

Thanks!

  • What API Version are you using? Make sure every class you use is updated to the most recent available version. – Adrian Larson May 31 '18 at 23:38
  • Good idea, thanks. I'll check the API versions tomorrow and report findings. Thanks! – Florissant53 Jun 1 '18 at 5:09
  • I couldn't find an API version on the Platform Event object itself, but the API on the trigger subscriber is 43.0. I also created a new Platform Event with no custom fields, just a plain new object and made sure it was deployed. Also created a trigger subscriber to go with it and made sure it was active (it has some debug statements in it). Still doesn't work. When I use anonymous Apex in the Developer Console to create a new event and publish it, the trigger doesn't run - no new log entries, and nothing in the UI to indicate the subscriber/trigger has processed any events. Strange!!!! – Florissant53 Jun 1 '18 at 16:30
  • Does the trigger call any classes? Check the version on those as well. – Adrian Larson Jun 1 '18 at 17:00
3

Deleting the Platform Event and recreating it seems to have fixed it.

I recreated it with exactly the same object name, and fields. Created another test trigger subscriber for it, and now it works.

Don't know what went wrong, but it appears this event and/or its event bus got broken somehow.

Very strange, but at least its working now.

0

I had the same issue. By upgrading the API version(from 40 to 43) for the Platform Event trigger seems to be working for my case. If your version is 43, then just update from 43 to 42 then update it back again. Because by updating the API version, from 43 to 42 then update it will do the thing. It is not the API version triggered this issue. I think by changing API version is a way to reactivate the Platform Event

  • 2
    The original poster states in comments that their trigger is already on API Version 43. – David Reed Aug 13 '18 at 2:33
  • @DavidReed, by updating the API version, from 43 to 42 then update it will do the thing. It is not the API version triggered this issue. I think by changing API version is a way to reactivate the Platform Event. – Alvin Zhou Aug 13 '18 at 5:52
  • I'd suggest editing your answer to clarify that for others who might stumble across this question in the future. – David Reed Aug 13 '18 at 11:15

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.