Skip to content
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

Retrieve and call handlers when cloud event is received #96

Conversation

DArdouin
Copy link
Contributor

@DArdouin DArdouin commented Jan 31, 2024

Description of changes

To complete the loop, we needed to retrieve the newly registered handler when raw events are processed, call them, and take action on events depending on the handling status.

Breaking changes

None

Additional checks

  • Added new tests that cover the code changes

@DArdouin DArdouin force-pushed the develop/PRO-2977_Call_handler_on_event branch 2 times, most recently from 0a8a832 to ddf4c0d Compare January 31, 2024 18:14
@DArdouin DArdouin force-pushed the develop/PRO-2977_Add_support_for_handler_registration branch from c912b46 to 5c7bab0 Compare January 31, 2024 18:15
@DArdouin DArdouin changed the title Now retrieve and call handlers when cloud event is received Retrieve and call handlers when cloud event is received Jan 31, 2024
@DArdouin DArdouin marked this pull request as ready for review January 31, 2024 18:29
@DArdouin DArdouin requested a review from a team as a code owner January 31, 2024 18:29
@DArdouin DArdouin force-pushed the develop/PRO-2977_Call_handler_on_event branch from ddf4c0d to e351c1d Compare January 31, 2024 21:47
@DArdouin DArdouin force-pushed the develop/PRO-2977_Add_support_for_handler_registration branch from 5c7bab0 to 1d63e00 Compare January 31, 2024 21:50
@DArdouin DArdouin force-pushed the develop/PRO-2977_Call_handler_on_event branch from e351c1d to 260545c Compare January 31, 2024 21:51
@DArdouin DArdouin force-pushed the develop/PRO-2977_Add_support_for_handler_registration branch from 1d63e00 to 033903b Compare January 31, 2024 22:35
Base automatically changed from develop/PRO-2977_Add_support_for_handler_registration to feature/Add_support_for_pullmode January 31, 2024 22:43
@DArdouin DArdouin dismissed felpel’s stale review January 31, 2024 22:43

The base branch was changed.

@DArdouin DArdouin force-pushed the develop/PRO-2977_Call_handler_on_event branch from b8e0063 to 6b43b82 Compare January 31, 2024 22:53
@DArdouin DArdouin merged commit c083cff into feature/Add_support_for_pullmode Feb 2, 2024
1 check passed
@DArdouin DArdouin deleted the develop/PRO-2977_Call_handler_on_event branch February 2, 2024 13:55
DArdouin added a commit that referenced this pull request Feb 2, 2024
* Now retrieve and call handlers when cloud event is received
DArdouin added a commit that referenced this pull request Feb 2, 2024
* Now retrieve and call handlers when cloud event is received
felpel pushed a commit that referenced this pull request Feb 26, 2024
* Now retrieve and call handlers when cloud event is received
felpel pushed a commit that referenced this pull request Feb 26, 2024
* Now retrieve and call handlers when cloud event is received
felpel pushed a commit that referenced this pull request Feb 27, 2024
* Now retrieve and call handlers when cloud event is received
felpel pushed a commit that referenced this pull request Feb 29, 2024
* Now retrieve and call handlers when cloud event is received
felpel pushed a commit that referenced this pull request Mar 4, 2024
* Now retrieve and call handlers when cloud event is received
felpel added a commit that referenced this pull request Mar 4, 2024
* Added support for event schema in DomainEvent (#72)

* Added support for event schema in DomainEvent
* Updated action filter to run CI

* Add option to support namespacetopic (#74)

* Added option for topic type

* Updated Generic publication methods to force using a non-abstract event (#76)

Now forces consumer to give a concrete event : before, it was silently failing when we were wrapping the event (we proceed to a check that it's not abstract when wrapping it).
Passing abstract events to publication methods will create a build-time error (instead of runtime).

* Added support to push CloudEvents to both Custom and Namespace topics (#75)

- Changed topic name from 'Default' to 'Custom'
- Added named EventGridClient to registered Azure client
- Updated EventPropagationClient
  - Can now push a CloudEvents to a CustomTopic
  - Support new kind of topic : Namespace topics where it can push CloudEvents (only)

* Skipped pipelines if CloudEvent (#77)

* Added a new project that will be used for pull model (#78)

* Added a new project that will be used for pull model

* Added options for subscriber (pull model) (#80)

Extension/Builder was used to follow what was already done for publisher / push model subscriber.

Added options plus validation for Subscriber (pull model)
Named options are supported so that we can register multiple subscribers to different topics
Added extension method and builder to register those options

* Moved type registry to reuse it in Subscriber.Pull dll (#81)

* Moved type registry to abstraction dll

* Added support to receive raw cloud events (#82)

* Added a background service responsible to pull and fanout message handling
* Added a try/catch within the EventPuller to make sure an error won't stop the pulling loop

* Wrapped cloud events when pulled and added delegates to handle event lifetime (#83)

* Added a cloud event handler that is called by puller to wrap cloud event
* Changed EventGridClient wrapper to apply adapter pattern
* Removed nullable on lock token, renamed some tests

* Extracted base handler shared between pull and push subscribers (#92)

Extracted base handler shared between pull and push subscribers

* Moved building logic to builder (#93)

Moved building block to builder instead of extension method, renamed building methods

* Extracted assembly helpers (#94)

* Moved methods used for handler registration in shared static helper
* Added missing extension methods for handler registration

* Added support to register event handlers (#95)

* Added a way to register domain event handlers using shared extension methods / helper
* Added a misconfigured dll for test purpose (multiple handlers)

* Retrieve and call handlers when cloud event is received (#96)

* Now retrieve and call handlers when cloud event is received

* Added missing link to JsonSerializerConstant following rebase on main

* Update documentation for push delivery support (#100)

* Update documentation for push delivery support

Co-authored-by: Félix Pelletier <felix.pelletier@gsoft.com>

* Added support for scoped dependency (#106)

* Added support for event schema in DomainEvent (#72)

* Added support for event schema in DomainEvent
* Updated action filter to run CI

* docs: fix wording for pull delivery documentation in README

Co-authored-by: Guillaume Caya-Letourneau <guillaume.caya.letourneau@gmail.com>

* docs: update EventPropagationClient's XML summary

Co-authored-by: Guillaume Caya-Letourneau <guillaume.caya.letourneau@gmail.com>

* [IDP-902] chore: fix warnings for analyzer rules (#113)

* chore: fix miscellaneous warnings regarding DomainEventAttribute

* chore: fix CA1008 warning for EventSchema enum

* chore: fix CA1852 warnings for internal test classes that were not sealed

* chore: fix CA1860 warning for DI extension method

* chore: applied various suggestions from analyzers for DomainEventSchemaCache and associated tests

* [IDP-902] feat(fix): address initial comments for #101 (#114)

* chore: cleanup unused warnings

* feat(refactor): rename the new Event Grid client being involved for event publishing

* feat(refactor): rename the DI setup method to configure the Event Grid publisher clients

* test(refactor): use xUnit's assertions rather than FluentAssertions for new test project

* test(refactor): remove warning by introducing a "fire & forget" mechanism for tasks, in a test context

* test(refactor): remove pragma warning disable for EventPullerTests by transforming it into an abstract class

* feat(refactor): rename the background service responsible of pulling Cloud Events from Azure Event Grid

* [IDP-902] deps: use non-vulnerable version for Azure.Identity (#118)

* deps: upgrade Azure.Identity to its latest version for security purposes
* deps(test): remove superfluous package reference in test project

* [IDP-902] feat(fix): address other comments for #101 (#117)

* ci: revert changes regarding CI triggers

* feat(refactor): remove distinct event name check in DomainEventWrapperCollection

* feat(refactor): move common logger and registration methods from abstractions project to the shared folder and fixed references

* feat(refactor): prevent sending CloudEvents events to custom topic

* feat(refactor): define single method to configure all clients' options

* chore: fix all PublicAPI.Shipped.txt & PublicAPI.Unshipped.txt so that newly introduced APIs are all part of the shipped files rather than unshipped

* chore: unblock CI build with dummy commit

* build: add dummy change to unblock CI

---------

Co-authored-by: Félix Pelletier <felix.pelletier@gsoft.com>
Co-authored-by: Guillaume Caya-Letourneau <guillaume.caya.letourneau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants