-
Notifications
You must be signed in to change notification settings - Fork 45
Add Reaction for dapr output bindings #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: nateb <[email protected]>
Signed-off-by: nateb <[email protected]>
Signed-off-by: nateb <[email protected]>
Signed-off-by: nateb <[email protected]>
Signed-off-by: nateb <[email protected]>
7c7c711
to
5932770
Compare
reactions/dapr/post-dapr-output-binding/Drasi.Reactions.PostDaprOutputBinding/QueryConfig.cs
Outdated
Show resolved
Hide resolved
?? throw new ArgumentNullException(nameof(config), $"Query configuration is null for query {queryId}"); | ||
|
||
// Check if the query is already in a failed state | ||
if (_failureTracker.IsQueryFailed(queryId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polly is the most popular .net library for resilience - https://www.pollydocs.org/
I think we should look at adopting that instead of writing our own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
reactions/dapr/post-dapr-output-binding/Drasi.Reactions.PostDaprOutputBinding/Program.cs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,59 @@ | |||
.PHONY: all deploy-postgres deploy-redis deploy-dapr-components build-subscribers load-subscribers deploy-subscribers logs-alpha logs-beta clean-subscribers clean-dapr-components clean-redis clean-postgres clean-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add an E2E tests like here?
# Conflicts: # .github/workflows/draft-release.yml # cli/installers/resources/default-reaction-providers.yaml
"bindingName": "drasi-output-binding", | ||
"bindingType": "http", | ||
"bindingOperation": "put" | ||
"packed": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to follow up on the enum instead of bool and add a comma
name: PostDaprOutputBinding | ||
spec: | ||
services: | ||
reaction: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to include the config schema section here. See the StorageQueue reaction for a relevant example.
reactions/dapr/post-output-binding/.idea/.idea.post-dapr-output-binding/.idea/indexLayout.xml
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// Implementation of the query failure tracker using ConcurrentDictionary. | ||
/// </summary> | ||
public class QueryFailureTracker : IQueryFailureTracker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use a library like Polly for this?
https://github.com/App-vNext/Polly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does invoking through Dapr not already add circuit breaker functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dapr provides a default circuit breaker https://docs.dapr.io/operations/resiliency/policies/default-policies/ would we need to extend it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would not need to do anything. If Dapr is already providing this functionality, we don't need to build it into the Reaction.
…t-binding/.idea directory
…n.DotSettings.user
Waiting on #226 will update with changes made and then rebase!
This pull request introduces a new reaction,
PostDaprOutputBindings
, to the system. It includes updates to configuration files, Dockerfiles, and the addition of unit tests for the new functionality. Below is a summary of the key changes:Dockerfile Additions
Dockerfile
forPostDaprOutputBinding
to build and publish the reaction using .NET 9.0, with production-specific logging configurations.Dockerfile.debug
for debugging purposes, including additional runtime dependencies and debug-specific logging configurations.Unit Tests for New Reaction
ChangeFormatter
inDrasi.Reactions.PostDaprOutputBinding.Tests/ChangeFormatterTests.cs
, covering scenarios like formatting added, updated, and deleted results.ChangeHandler
inDrasi.Reactions.PostDaprOutputBinding.Tests/ChangeHandlerTests.cs
, testing behavior for various configurations, error handling, and event publishing.# DescriptionPlease explain the changes you've made.
Type of change
Implements #248