{"id":"af6656e5-f8a1-4f18-9dbe-e5720211215e","task":"Subscribe to Salesforce Pub/Sub API events via gRPC to receive high-throughput Platform Events","domain":"developer.salesforce.com","steps":["Connect to the Salesforce Pub/Sub API gRPC endpoint at api.pubsub.salesforce.com:7443 using a gRPC client library in your language of choice","Obtain a Salesforce access token and instance URL via the OAuth 2.0 JWT Bearer or Username-Password flow, then attach them as gRPC metadata headers (accesstoken, instanceurl, tenantid)","Call the Subscribe RPC with a SubscribeRequest specifying the topic name (e.g., /event/MyEvent__e), the replayPreset (LATEST, EARLIEST, or CUSTOM), and a numRequested value per fetch batch","Decode each FetchResponse: events are encoded in Apache Avro binary format using the schema fingerprint in the event; fetch the schema via the GetSchema RPC using the schemaId from the event","Cache schemas by schemaId to avoid a GetSchema round trip on every event — schemas are immutable once published for a given fingerprint","Acknowledge processed events by sending a new SubscribeRequest with the latest replayId to advance the subscription cursor and prevent redelivery"],"gotchas":["The Pub/Sub API gRPC endpoint is api.pubsub.salesforce.com — not pubsub.salesforce.com — using the wrong hostname causes TLS certificate mismatch errors that appear as generic connection failures","gRPC streams have a maximum duration after which the server closes the stream; implement automatic reconnect with the last known replayId to resume without gaps","Avro schema evolution is additive only in Salesforce Pub/Sub — removing or renaming a field in the Platform Event definition may still deliver events using an older schema fingerprint for events already in the buffer"],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:23.292Z"},"url":"https://mcp.waymark.network/r/af6656e5-f8a1-4f18-9dbe-e5720211215e"}