From 60e1c2160aeaa255c9bca1f31f79049a5ccf8cef Mon Sep 17 00:00:00 2001 From: sheheryar aamir Date: Tue, 26 Mar 2024 21:33:26 +0100 Subject: [PATCH] (docs): updated google pubsub binding annotation document --- docs/configuration/documenting-bindings.md | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/configuration/documenting-bindings.md b/docs/configuration/documenting-bindings.md index 0661ecc..9eba9e8 100644 --- a/docs/configuration/documenting-bindings.md +++ b/docs/configuration/documenting-bindings.md @@ -115,4 +115,42 @@ The group id that will be used during message consumption #### Client Id The client id to identify the consumer +### Google PubSub binding annotations +#### Channel Binding Object +The Channel Bindings Object is used to describe the Google Cloud Pub/Sub Topic details. +```java +@GooglePubSubAsyncChannelBinding( + messageRetentionDuration = "messageRetentionDuration", + messageStoragePolicy = + @GooglePubsubAsyncMessageStoragePolicy(allowedPersistenceRegions = {"region1", "region2"}), + schemaSettings = + @GooglePubSubAsyncSchemaSetting( + encoding = "BINARY", + firstRevisionId = "firstRevisionId", + lastRevisionId = "lastRevisionId", + name = "projects/{project}/schemas/{schema}")) +``` +MessageRetentionDuration: Indicates the minimum duration to retain a message after it is published to the topic + +Message Storage Policy: The Message Storage Policy Object is used to describe the Google Cloud Pub/Sub MessageStoragePolicy. +- A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage + +Schema Settings:The Schema Settings Object is used to describe the Google Cloud Pub/Sub SchemaSettings. +- encoding: The encoding of the message +- firstRevisionId: The minimum (inclusive) revision allowed for validating messages +- lastRevisionId: The maximum (inclusive) revision allowed for validating messages +- name: The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.) +#### Message Binding Object +The Message Binding Object is used to describe the Google Cloud Pub/Sub PubsubMessage details, alongside with pertintent parts of the Google Cloud Pub/Sub Schema Object. +```java +@GooglePubSubAsyncMessageBinding( + orderingKey = "key", + schema = @GooglePubSubAsyncMessageSchema(name = "projects/{project}/schemas/{schema}")) +``` +OrderingKey: If non-empty, identifies related messages for which publish order should be respected + +Schema Definition: The Schema Definition Object is used to describe the Google Cloud Pub/Sub Schema Object with AsyncAPI. While some of this information could be, or is, described using native AsyncAPI, for consistency it makes sense to provide this information here at all times, especially for cases where AsyncAPI does not natively support describing payloads using a supported Google Cloud Pub/Sub schema format like Protobuf +- name: The name of the schema + + [operation-binding]: https://www.asyncapi.com/docs/reference/specification/v2.6.0#operationBindingsObject