-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make external event payloads strongly typed #907
Conversation
Modules/Synchronization/src/Synchronization.Domain/Entities/Sync/ExternalEvent.cs
Show resolved
Hide resolved
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.
I noticed that in DomainEvents.Incoming
most of the files we have a Handle
method and a CreateExternalEvents
but in
IdentityDeletionProcessStartedDomainEventHandler
IdentityDeletionProcessStatusChangedDomainEventHandler
RelationshipStatusChangedDomainEventHandler
we don't follow this "pattern". So for consistency sake I would refactor the above three mentioned files to have a Handle
and a CreateExternalEvents
method. What do you think about this?
...mainEvents/Incoming/RelationshipStatusChanged/RelationshipStatusChangedDomainEventHandler.cs
Outdated
Show resolved
Hide resolved
.../Synchronization/src/Synchronization.Application/Infrastructure/ISynchronizationDbContext.cs
Show resolved
Hide resolved
...n.Infrastructure/Persistence/Database/Configurations/ExternalEventEntityTypeConfiguration.cs
Outdated
Show resolved
Hide resolved
...re/Persistence/Database/ValueConverters/ExternalEventPayloadEntityFrameworkValueConverter.cs
Outdated
Show resolved
Hide resolved
Modules/Synchronization/test/Synchronization.Domain.Tests/ExternalEventTests.cs
Outdated
Show resolved
Hide resolved
...nchronization.Application/DomainEvents/Incoming/PeerDeleted/PeerDeletedDomainEventHandler.cs
Outdated
Show resolved
Hide resolved
...nization/src/Synchronization.Infrastructure/Persistence/Database/SynchronizationDbContext.cs
Show resolved
Hide resolved
@tnotheis Thoughts on this? It seems you missed this one. |
@HunorTotBagi Sorry, you're right. I didn't see that. I just fixed it. I also renamed the methods so they contain the name of the event that is created. So if there is another external event created by the same domain event handler, we would do this in another private method. Further, I moved the try/catch block to the Btw: I think we could even remove the try/catch blocks, because the EventBus classes already log descriptive error messages. But I will not remove them in this PR. |
Thanks, I like the changes. I also noticed that the naming of the parameters in the |
Done |
Readiness checklist
So far the payloads of the external events have been anonymous objects. This isn't ideal, so this PR introduces a subclass of
ExternalEvent
for each external event type.