Loading

Proactive Alert Monitoring: Hourly Platform Event Publishing Limit

Publiseringsdato: Jan 26, 2024
Beskrivelse

Platform events are leveraged to connect business processes in Salesforce to external apps through the exchange of real-time event data. Salesforce applies a limit to the number of Platform Events published per hour. This applies to all publishing methods including Apex, APIs, flows & processes. The limit being used is Event Publishing: maximum number of event notifications published per hour

In the event this limit is hit, subsequent events may not be published to the event bus for up to one hour or until the limit resets. 

The Signature Success plan’s Proactive Monitoring product will monitor for, and alert you to, high consumption against this limit. This article outlines some scenarios to help you investigate should you receive an alert. In addition, on the Salesforce Help site Designated contacts and above can see your realtime metrics, alerts & more.

In addition, for platform events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query.

  • PLATFORM_EVENTS_PUBLISHED—Number of platform events published
  • PLATFORM_EVENTS_DELIVERED—Number of platform events delivered to CometD and Pub/Sub API clients

 

Causes

Possible high limit consumption scenarios:

  • Poorly publishing methods, Apex, Pub/Sub API, and other API's, flows
  • Poorly configured Process Builder 

 

    Løsning

    Here are a few suggestions and resources that may help to resolve or better control high limit usage.

    Apex:

    • To publish event messages, call the EventBus.publish method. For example, if you defined a custom platform event called Low Ink, reference this event type as Low_Ink__e. Next, create instances of this event, and then pass them to the Apex method.
    • Publish Event Messages with Apex


    Pub/Sub API:

    • 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. Based on gRPC and HTTP/2, Pub/Sub API enables efficient publishing of binary event messages in the Apache Avro format.
    • Publish Event Messages with Pub/Sub API


    APIs:

    • When publishing an event message, the result that the API returns contains information about whether the operation was successful and the errors encountered. If the success field is true, the publish request is queued in Salesforce and the event message is published asynchronously. For more details, see High-Volume Platform Event Persistence. If the success field is false, the event publish operation resulted in errors, which are returned in the errors field.
    • Publish Event Messages with Salesforce APIs


    Flows:

    • Use flows to publish event messages from a Salesforce app as part of some user interaction, an automated process, Apex, or workflow action.
    • Publish Event Messages with Flows
       


    Processes:

    • To publish event messages, add a Create a Record action to the appropriate process. Where you'd usually pick an object to create, select the custom platform event.
    • Publish Event Messages with Processes
       

    To monitor your org's event delivery hourly usage, make a REST API call to the limits resource every hour.


    Help and Developer resources

    Knowledge-artikkelnummer

    000392500

     
    Laster
    Salesforce Help | Article