UPDATE
I have also discussed this topic with some more detail on on my blog here.
Based on your requirements where:
External System will push data in Salesforce.
My recommendation is to construct REST APIs for this purpose which the External Systems can utilize to send data to Salesforce. Platform Events are more targeted towards a Pub/Sub model, where you may want to "trigger" a notification from/to Salesforce to all subscribers and based on that notification the subscriber then takes necessary action. Excerpt from the documentation:
Platform events simplify the process of communicating changes and responding to them without writing complex logic. Publishers and subscribers communicate with each other through events. One or more subscribers can listen to the same event and carry out actions.
If at all you want the External System to "act upon" only when an event has occurred in Salesforce, you can then have Platform Events in this case, where the External System (the subscriber) is subscribed to the events in Salesforce and then sends data to Salesforce. Even in this case, you still need an API exposed for the External System to send data in Salesforce.
One of the most important factors to consider here is what is your integration approach. If you want a more "traditional integration", say point to point (not going into M/W details here), and that the External System always knows at what time they need to send data to Salesforce, go for REST API.
If you want your External System to notify you or if you want the External System to be notified for it to initiate the operation, that is when you should consider the event route (pub/sub).
Hope this helps.
According to Proactive Alert Monitoring: Durable Streaming API Limit there are two scenarios that will result in the Organization total events daily limit exceeded. error message.
- Excessive record updates triggering notifications
- Exceeding concurrent subscriber limitations
For the second scenario the help doc goes onto explain:
Exceeding concurrent subscriber limitations
The maximum concurrent subscriber count for streaming API daily limits is 10 across all Salesforce organization editions. This is a static limit and cannot be increased with a support request.
That sounds a lot like the "Maximum number of concurrent CometD clients (subscribers) across all channels and for all event types" limit from Platform Event Allocations.
While the first help doc implies a hard limit of 10, the latter has it ranging from 20 all the way up to 2,000 clients depending on the org edition.
It may well be that the first doc is out of date. It does seem odd that this error message would have anything to do with concurrent subscribers rather than the volume of events.
Another reference for that message is in the Streaming API Error Codes.
Organization total events daily limit exceeded
The maximum number of daily events has been exceeded. This error applies to any type of event, including PushTopic, generic, and platform events.
Are you using High-Volume Events? It kind of looks like you are as the MonthlyPlatformEvents limit is down to 1,452,923 from 1,500,000. What is really odd about that limit is the documentation - Monitor Your High-Volume Event Usage (my emphasis).
To monitor your monthly event delivery usage, use the limits REST API resource, and inspect the MonthlyPlatformEvents value. The limits resource returns the monthly maximum allocation. If you don’t have an add-on license, your daily default maximum allocation is the monthly allocation returned divided by 30.
From my reading you are borderline on the edge of that limit. It may just be that the REST limits resource hasn't caught up with the actual usage yet.
I'd revisit the limits resource at intervals after the error occurs to see it the values change.
Best Answer
Maximum size allowed is 1048576 bytes (1.05MB)
When you exceed the limit, you will get below message:
TESTING:
Create a platform event POC_PE__e and create 9 long text fields and use below apex method:
Long_String__c, Long_String2__c.... are event fields.
Solution:
Use this method to get string bytes size (used in example above)
Got to this by using https://mothereff.in/byte-counter. Number of chars is same as number of bytes. Note: we get exact bytes size (1179064 bytes) shown in error message (1179064 bytes).
Conclusion: Salesforce serialises the event object(s) for transmitting to various destinations and deserialises before delivering. Only data is calculated for message size and not field API or Object API names.
Additional info:
Same is the case with lightning platform - got confirmation from salesforce support. Thats the reason you see error message on object record page when so many formula,lookup,rich text fields are included in page layout