Skip to content

Commit

Permalink
Merge branch 'master' into 3156-shutdown-and-handlers-map
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro (Ale) Segala <[email protected]>
  • Loading branch information
ItalyPaleAle authored Oct 31, 2023
2 parents 4d8b903 + d47d1a7 commit 36e742a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
28 changes: 27 additions & 1 deletion .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 Expand Up @@ -233,7 +259,7 @@ func (c *ComponentMetadata) AppendBuiltin() error {
Example: `"/custom-path"`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/developing-applications/building-blocks/bindings/howto-triggers/#specifying-a-custom-route",
URL: "https://docs.dapr.io/developing-applications/building-blocks/bindings/howto-triggers/#specify-a-custom-route",
},
},
)
Expand Down
8 changes: 4 additions & 4 deletions pubsub/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ func (r *rabbitMQ) Init(_ context.Context, metadata pubsub.Metadata) error {

r.metadata = meta

r.reconnect(0)
// We do not return error on reconnect because it can cause problems if init() happens
// right at the restart window for service. So, we try it now but there is logic in the
// code to reconnect as many times as needed.
if err := r.reconnect(0); err != nil {
return err
}

return nil
}

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 36e742a

Please sign in to comment.