Newer Version Available
Enterprise Messaging Platform Events
You can customize the schema of platform events to define which data types to send in a message.
You can publish and consume platform events by using Apex or an API. Platform events integrate with the Salesforce platform through Apex triggers. Triggers are the event consumers on the Salesforce platform that listen to event messages. Whether an external app through the API or a native Force.com app through Apex published the event message, a trigger on that event gets fired. Triggers run the actions in response to the event notifications.
For example, a software system monitoring a printer makes an API call to publish a custom event when the ink is low. The printer event message contains custom fields for the printer model, serial number, and ink level. After the printer sends the event message, an Apex trigger is fired in Salesforce. The trigger creates a Case record to place an order for a new cartridge.
As an alternative to using Apex triggers, external apps can listen to event notifications by subscribing to a channel through CometD.