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.
Publish and pull messages from Google Cloud Pub/Sub topics from Delphi. Service-account JWT signing and typed Publish / Pull / Acknowledge methods.
Google Cloud Pub/Sub REST client — create topics, publish messages, pull from subscriptions, acknowledge or modify ack deadlines from a typed Delphi component.
TsgcHTTPGoogleCloud_PubSub_Client
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Load your service-account JSON, setze 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');
// veröffentlichen
PubSub.Publish('projects/your-project/topics/topic-id',
'{"event":"order_created","id":42}');
// abrufen
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);
Wraps the Pub/Sub REST surface mit dem standard Google service-account auth flow.
CreateTopic, DeleteTopic, GetTopic, ListTopics hit the /projects/<id>/topics endpoint family.
Publish sends one or more PubsubMessage entries with optional attributes and ordering keys, returning the assigned messageIds.
Pull(subscription, maxMessages) returns received messages with their ackId; Acknowledge(subscription, ackIds) finalises them, ModifyAckDeadline extends processing time.
Same auth flow as the FCM and Calendar siblings — loads the JSON key, signs an RS256 JWT, exchanges for an OAuth token, refreshes wenn needed.
CreateSubscription, DeleteSubscription, UpdateSubscription, ListSubscriptions manage the subscription side of Pub/Sub.
Pull subscriptions are read with Pull; push subscriptions are configured to call your endpoint — typically a TsgcWebSocketHTTPServer instance behind a public URL.
Maßgebliche Quellen für die API, die diese Komponente implementiert.
Springe direkt zur Komponentenreferenz, lade das einsatzbereite Demo-Projekt herunter und teste die Testversion.
| Online-Hilfe — Google Pub/Sub Client Vollständige Eigenschaften-, Methoden- und Ereignisreferenz für diese Komponente. | Öffnen | |
| Demo Project — Demos\20.HTTP_Protocol\03.Google Einsatzbereites Beispielprojekt. Im sgcWebSockets-Paket enthalten — lade unten die Testversion herunter. | Öffnen | |
| Technisches Dokument (PDF) Funktionen, Schnellstart, Codebeispiele für Delphi & C++ Builder und Primärquellenreferenzen — nur für diese Komponente. | Öffnen | |
| Benutzerhandbuch (PDF) Umfassendes Handbuch zu jeder Komponente der Bibliothek. | Öffnen |