Welcome to Pub/Sub API! Pub/Sub API provides a single interface for publishing and subscribing to platform events, including real-time event monitoring events, and change data capture events. Based on gRPC and HTTP/2, Pub/Sub API enables efficient delivery of binary event messages in the Apache Avro format.
This repo contains the critical proto file that you will need to use the API.
gRPC officially supports 11 languages, but there is unofficial community support in more. To encode and decode events, an Avro library for your language of choice will be needed. See below for which officially supported languages have well-supported Avro libraries:
Supported gRPC Language | Avro Libraries |
---|---|
C# | AvroConvert Apache Avro C# (docs are not great) |
C++ | Apache Avro C++ |
Dart | avro-dart (last updated 2012) |
Go | goavro |
Java | Apache Avro Java |
Kotlin | avro4k |
Node | avro-js |
Objective C | ObjectiveAvro (but read this) |
PHP | avro-php |
Python | Apache Avro Python |
Ruby | AvroTurf |
- Pub/Sub API Developer Guide
- Salesforce Architects Blog Post
- Introducing the New gRPC-based Pub Sub API YouTube Developer Quick Takes
Salesforce provides these samples for demonstration purposes. They aren't meant to be used in production code. Before you use these samples in production, make sure you perform thorough functional and performance testing.
- Java Quick Start in the Developer Guide
- Python Quick Start in the Developer Guide
- Python Code Examples
- Go Code Examples
- Java Code Examples
These examples are developed by the community. They aren't supported by Salesforce. Use at your own discretion.
If you have a code sample for Pub/Sub API that you would like to add a link to in this section, submit a PR with the modified readme page. We don't guarantee that we can link to all samples. Priority will be given to samples implemented in a programming language that is not represented in this repository's samples.