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

Add optimistic concurrency to samples #100

Merged
merged 15 commits into from Mar 3, 2022

Conversation

oskardudycz
Copy link
Owner

@oskardudycz oskardudycz commented Mar 1, 2022

Added optimistic concurrency to samples and did a huge all-around refactoring.

The most significant changes:

  • Added OptimisticConcurrencyMiddleware and related classes to support full flow based on the ETag. Applied both for Marten and EventStoreDB samples,
  • Aligned convention around Records (use them for DTOs with static factory method for validation),
  • Introduced StreamEvent for EventStoreDB subscriptions to gather information about stream revision and global position. That can be used for idempotency checks in projections.
  • Made MartenExternalProjection, EntityFrameworkProjection idempotent,
  • Merged EventStoreDB improvements from Simple EventStoreDB examples into Core project,
  • Added NoMediatorEventBus to not rely on the marker interfaces need etc.
  • Aligned ECommerce samples:
    • API structure and models
    • The same set of integration tests,
    • Naming and structure conventions
  • Added CorrelationIdMiddleware and plugged it initially. More changes will come in the follow-up PR,
  • Unified background processing for ESDB Subscriptions and Kafka Consumers

Fixes #50

- Optimistic Concurrency
- CorrelationId

Updated ApiFixture to allow setting requests headers
…read models) to have full optimistic concurrency flow.

Aligned API project with Simple Event Sourcing samples, to be closer to each other.
Moved Stream revision related classes to EventStoreDB related project.
… repository as a preparation to have different optimistic concurrency handling for each of them.
…ommerce example

Aligned naming and tests with other ECommerce examples
Aligned namespaces across the solution
- optimistic concurrency handling for Marten projects
- conventions around record usage for commands, queries and events
- API projects setup
…ency scope instead of having classes injected
@oskardudycz oskardudycz force-pushed the add_optimistic_concurrency_to_samples branch from 3a0c3bd to 0aa3233 Compare March 3, 2022 05:53
@oskardudycz oskardudycz force-pushed the add_optimistic_concurrency_to_samples branch from 0aa3233 to c24da62 Compare March 3, 2022 06:05
@oskardudycz oskardudycz merged commit 1134aa8 into main Mar 3, 2022
@oskardudycz oskardudycz deleted the add_optimistic_concurrency_to_samples branch March 3, 2022 07:36
@mehdihadeli
Copy link

mehdihadeli commented Mar 3, 2022

Hi @oskardudycz ,
Hope you are doing well :)
I saw your pull request about concurrency with using ETag, it was very interesting approach.
I have a question, What about using aggregate version property for handling concurrency? As you have it in your code, but you didn't use it for handling concurrency. Using this version is not simpler?

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.

Add Optimistic Concurrency handling in samples
2 participants