Skip to content

Commit

Permalink
(docs): updated google pubsub binding annotation document
Browse files Browse the repository at this point in the history
  • Loading branch information
SheheryarAamir authored and timonback committed Apr 1, 2024
1 parent 2dcbeea commit 60e1c21
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/configuration/documenting-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 60e1c21

Please sign in to comment.