Skip to content

Commit 60e1c21

Browse files
SheheryarAamirtimonback
authored andcommitted
(docs): updated google pubsub binding annotation document
1 parent 2dcbeea commit 60e1c21

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/configuration/documenting-bindings.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,42 @@ The group id that will be used during message consumption
115115
#### Client Id
116116
The client id to identify the consumer
117117

118+
### Google PubSub binding annotations
119+
#### Channel Binding Object
120+
The Channel Bindings Object is used to describe the Google Cloud Pub/Sub Topic details.
121+
```java
122+
@GooglePubSubAsyncChannelBinding(
123+
messageRetentionDuration = "messageRetentionDuration",
124+
messageStoragePolicy =
125+
@GooglePubsubAsyncMessageStoragePolicy(allowedPersistenceRegions = {"region1", "region2"}),
126+
schemaSettings =
127+
@GooglePubSubAsyncSchemaSetting(
128+
encoding = "BINARY",
129+
firstRevisionId = "firstRevisionId",
130+
lastRevisionId = "lastRevisionId",
131+
name = "projects/{project}/schemas/{schema}"))
132+
```
133+
MessageRetentionDuration: Indicates the minimum duration to retain a message after it is published to the topic
134+
135+
Message Storage Policy: The Message Storage Policy Object is used to describe the Google Cloud Pub/Sub MessageStoragePolicy.
136+
- A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage
137+
138+
Schema Settings:The Schema Settings Object is used to describe the Google Cloud Pub/Sub SchemaSettings.
139+
- encoding: The encoding of the message
140+
- firstRevisionId: The minimum (inclusive) revision allowed for validating messages
141+
- lastRevisionId: The maximum (inclusive) revision allowed for validating messages
142+
- name: The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.)
143+
#### Message Binding Object
144+
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.
145+
```java
146+
@GooglePubSubAsyncMessageBinding(
147+
orderingKey = "key",
148+
schema = @GooglePubSubAsyncMessageSchema(name = "projects/{project}/schemas/{schema}"))
149+
```
150+
OrderingKey: If non-empty, identifies related messages for which publish order should be respected
151+
152+
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
153+
- name: The name of the schema
154+
155+
118156
[operation-binding]: https://www.asyncapi.com/docs/reference/specification/v2.6.0#operationBindingsObject

0 commit comments

Comments
 (0)