Google Cloud Pub/Sub

Publish and pull messages from Google Cloud Pub/Sub topics from Delphi. Service-account JWT signing and typed Publish / Pull / Acknowledge methods.

TsgcHTTPGoogleCloud_PubSub_Client

Google Cloud Pub/Sub REST client — create topics, publish messages, pull from subscriptions, acknowledge or modify ack deadlines from a typed Delphi component.

Clase del componente

TsgcHTTPGoogleCloud_PubSub_Client

Protocolo

Pub/Sub REST API

Plataformas

Windows, macOS, Linux, iOS, Android

Edición

Standard / Professional / Enterprise

Load service account, publish, pull

Load your service-account JSON, set the project id, then call Publish to send a message and Pull to consume from a subscription.

uses
  sgcHTTP;

var
  PubSub: TsgcHTTPGoogleCloud_PubSub_Client;
begin
  PubSub := TsgcHTTPGoogleCloud_PubSub_Client.Create(nil);
  PubSub.GoogleCloudOptions.ServiceAccountJSON.LoadFromFile('service-account.json');

  // publish
  PubSub.Publish('projects/your-project/topics/topic-id',
    '{"event":"order_created","id":42}');

  // pull
  Memo1.Text := PubSub.Pull('projects/your-project/subscriptions/sub-id', 10);
end;
// uses: sgcHTTP
TsgcHTTPGoogleCloud_PubSub_Client *PubSub = new TsgcHTTPGoogleCloud_PubSub_Client(this);
PubSub->GoogleCloudOptions->ServiceAccountJSON->LoadFromFile("service-account.json");

PubSub->Publish("projects/p/topics/t", payload);
Memo1->Text = PubSub->Pull("projects/p/subscriptions/s", 10);

Qué incluye

Wraps the Pub/Sub REST surface with the standard Google service-account auth flow.

Topic management

CreateTopic, DeleteTopic, GetTopic, ListTopics hit the /projects/<id>/topics endpoint family.

Publish

Publish sends one or more PubsubMessage entries with optional attributes and ordering keys, returning the assigned messageIds.

Pull / Acknowledge

Pull(subscription, maxMessages) returns received messages with their ackId; Acknowledge(subscription, ackIds) finalises them, ModifyAckDeadline extends processing time.

Service-account JWT

Same auth flow as the FCM and Calendar siblings — loads the JSON key, signs an RS256 JWT, exchanges for an OAuth token, refreshes when needed.

Subscription management

CreateSubscription, DeleteSubscription, UpdateSubscription, ListSubscriptions manage the subscription side of Pub/Sub.

Push or pull

Pull subscriptions are read with Pull; push subscriptions are configured to call your endpoint — typically a TsgcWebSocketHTTPServer instance behind a public URL.

Especificaciones y referencias

Authoritative sources for the API this component implements.

Documentación y Demos

Enlace directo a la referencia del componente, descarga el proyecto demo listo para ejecutar y la prueba gratuita.

Online Help — Google Pub/Sub Client Referencia completa de propiedades, métodos y eventos de este componente.
Demo Project — Demos\20.HTTP_Protocol\03.Google Proyecto de ejemplo listo para ejecutar. Se incluye en el paquete sgcWebSockets — descarga la prueba gratuita más abajo.
Documento técnico (PDF) Características, inicio rápido, ejemplos de código para Delphi y C++ Builder y referencias de fuentes primarias — solo este componente.
Manual de usuario (PDF) Manual completo que cubre todos los componentes de la biblioteca.

Ready to Use Cloud Pub/Sub from Delphi?

Download the free trial and integrate Google Cloud Pub/Sub into your Delphi applications.