Skip to content

Commit

Permalink
Adds outbox metadata fields (#3186)
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Alessandro (Ale) Segala <[email protected]>
Co-authored-by: Alessandro (Ale) Segala <[email protected]>
  • Loading branch information
elena-kolevska and ItalyPaleAle authored Oct 22, 2023
1 parent 84cc54b commit ddc10f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .build-tools/pkg/metadataschema/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,32 @@ func (c *ComponentMetadata) AppendBuiltin() error {
},
)
}
if slices.Contains(c.Capabilities, "transactional") {
c.Metadata = append(c.Metadata,
Metadata{
Name: "outboxPublishPubsub",
Type: "string",
Description: "For outbox. Sets the name of the pub/sub component to deliver the notifications when publishing state changes",
},
Metadata{
Name: "outboxPublishTopic",
Type: "string",
Description: `For outbox. Sets the topic that receives the state changes on the pub/sub configured with "outboxPublishPubsub". The message body will be a state transaction item for an insert or update operation`,
},
Metadata{
Name: "outboxPubsub",
Type: "string",
Description: `For outbox. Sets the pub/sub component used by Dapr to coordinate the state and pub/sub transactions. If not set, the pub/sub component configured with "outboxPublishPubsub" is used. This is useful if you want to separate the pub/sub component used to send the notification state changes from the one used to coordinate the transaction`,
Default: "outboxPublishPubsub",
},
Metadata{
Name: "outboxDiscardWhenMissingState",
Description: "By setting outboxDiscardWhenMissingState to true, Dapr discards the transaction if it cannot find the state in the database and does not retry. This setting can be useful if the state store data has been deleted for any reason before Dapr was able to deliver the message and you would like Dapr to drop the items from the pub/sub and stop retrying to fetch the state",
Type: "bool",
Default: "false",
},
)
}

c.Metadata = append(c.Metadata,
Metadata{
Expand Down
2 changes: 1 addition & 1 deletion state/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ capabilities:
authenticationProfiles:
- title: "Connection string"
description: |
Authenticate using a connetion string.
Authenticate using a connection string.
metadata:
- name: connectionString
required: true
Expand Down

0 comments on commit ddc10f7

Please sign in to comment.