Make Apex Callouts After Publishing Platform Event Messages
Where: This change applies to Enterprise, Performance, Unlimited, and Developer editions.
Why: Events configured with the Publish Immediately behavior are published when the call executes and they don't depend on the successful completion of the transaction. These events are used for tracking and logging purposes. With this change, they aren't considered part of the transaction's DML operations, and therefore no longer prevent Apex callouts from being performed after publishing. They count against a new, separate publishing limit of 150 EventBus.publish() calls. This change doesn't apply to events configured with the Publish After Commit behavior, whose publishing is considered part of the transaction's DML operations. The publishing of these events still counts against the Apex DML statement limit. And you can still make Apex callouts after publishing.
To track the limit usage of EventBus.publish() calls for immediate publishing, use the Limits.getPublishImmediateDML() and Limits.getLimitPublishImmediateDML() Apex methods.