Publish RPC Method

The Publish method is a unary RPC, which means that it sends only one request and receives only one response. It synchronously publishes the batch of events in PublishRequest to an event bus topic. After publishing the event messages, the server sends a response to the client. Use the Publish method if you want to know the status of a publish operation before publishing the next batch of event messages.

The PublishResponse holds a PublishResult for each event published that indicates success or failure of the publish operation. A successful status means that the event was published and is in the event bus. A failed status means that the event failed to publish. You can retry publishing a failed event. If you publish a batch of events, the order of publish results corresponds to the order of the events in the publish request. You can correlate each successful or failed result with the corresponding event in the publish request.

For more information about the fields in PublishRequest and PublishResponse, see the Pub/Sub API proto file.