diff --git a/.github/workflows/build.dotnet.yml b/.github/workflows/build.dotnet.yml index 6062c0a2f..397c196ae 100644 --- a/.github/workflows/build.dotnet.yml +++ b/.github/workflows/build.dotnet.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Start containers - run: docker-compose --profile ci up -d + run: docker compose --profile ci up -d - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -36,4 +36,4 @@ jobs: - name: Stop containers if: always() - run: docker-compose --profile ci down + run: docker compose --profile ci down diff --git a/README.md b/README.md index d433cd6fe..8200b26cb 100644 --- a/README.md +++ b/README.md @@ -629,7 +629,7 @@ For running the Event Store examples you need to have: 2. [Docker](https://store.docker.com/search?type=edition&offering=community) installed. Then going to the `docker` folder and running: ``` -docker-compose --profile all up +docker compose --profile all up ``` **More information about using .NET, WebApi and Docker you can find in my other tutorials:** [WebApi with .NET](https://github.com/oskardudycz/WebApiWith.NETCore) diff --git a/Sample/ECommerce/README.md b/Sample/ECommerce/README.md index 77a06adec..4d33beaff 100644 --- a/Sample/ECommerce/README.md +++ b/Sample/ECommerce/README.md @@ -16,13 +16,13 @@ 10. Open `PracticalEventSourcing.sln` solution. 11. Docker useful commands - - `docker-compose up` - start dockers - - `docker-compose kill` - to stop running dockers. - - `docker-compose down -v` - to clean stopped dockers. + - `docker compose up` - start dockers + - `docker compose kill` - to stop running dockers. + - `docker compose down -v` - to clean stopped dockers. - `docker ps` - for showing running dockers - `docker ps -a` - to show all dockers (also stopped) -12. Go to [docker](./docker) and run: `docker-compose up`. +12. Go to [docker](./docker) and run: `docker compose up`. 13. Wait until all dockers got are downloaded and running. 14. You should automatically get: - Postgres DB running diff --git a/Sample/EventStoreDB/ECommerce/README.md b/Sample/EventStoreDB/ECommerce/README.md index 8c819aff1..99b62b8f6 100644 --- a/Sample/EventStoreDB/ECommerce/README.md +++ b/Sample/EventStoreDB/ECommerce/README.md @@ -14,7 +14,7 @@ Sample is showing the typical flow of the Event Sourcing app with [EventStoreDB] ## Running -1. Go to [docker](./docker) and run: `docker-compose up`. +1. Go to [docker](./docker) and run: `docker compose up`. 2. Wait until all dockers got are downloaded and running. 3. You should automatically get: - EventStoreDB UI (for event store): http://localhost:2113/ @@ -66,9 +66,9 @@ It uses: ## Trivia 1. Docker useful commands - - `docker-compose up` - start dockers - - `docker-compose kill` - to stop running dockers. - - `docker-compose down -v` - to clean stopped dockers. + - `docker compose up` - start dockers + - `docker compose kill` - to stop running dockers. + - `docker compose down -v` - to clean stopped dockers. - `docker ps` - for showing running dockers - `docker ps -a` - to show all dockers (also stopped) diff --git a/Sample/EventStoreDB/Simple/README.md b/Sample/EventStoreDB/Simple/README.md index 5478f71dd..b4b774c4b 100644 --- a/Sample/EventStoreDB/Simple/README.md +++ b/Sample/EventStoreDB/Simple/README.md @@ -62,7 +62,7 @@ API integration tests for: ## Running -1. Go to [docker](./docker) and run: `docker-compose up`. +1. Go to [docker](./docker) and run: `docker compose up`. 2. Wait until all dockers got are downloaded and running. 3. You should automatically get: - EventStoreDB UI (for event store): http://localhost:2113/ diff --git a/Sample/Helpdesk/Helpdesk.Api/Dockerfile b/Sample/Helpdesk/Helpdesk.Api/Dockerfile index c7018320f..7060c4ae7 100644 --- a/Sample/Helpdesk/Helpdesk.Api/Dockerfile +++ b/Sample/Helpdesk/Helpdesk.Api/Dockerfile @@ -21,7 +21,7 @@ RUN dotnet restore ./${project_name}.csproj COPY ./ ./ # Run code generation depending on the build argument -RUN if [ "${run_codegen}" = true ] ; then dotnet run -- codegen write & dotnet run -- codegen test; else echo "skipping code generation"; fi +RUN dotnet run -- codegen write & dotnet run -- codegen test RUN ls RUN ls -R Internal diff --git a/Sample/Helpdesk/Helpdesk.Api/Program.cs b/Sample/Helpdesk/Helpdesk.Api/Program.cs index 69e186ffd..f79f777f9 100644 --- a/Sample/Helpdesk/Helpdesk.Api/Program.cs +++ b/Sample/Helpdesk/Helpdesk.Api/Program.cs @@ -11,10 +11,12 @@ using JasperFx.CodeGeneration; using Marten; using Marten.AspNetCore; +using Marten.Events; using Marten.Events.Daemon.Resiliency; using Marten.Events.Projections; using Marten.Pagination; using Marten.Schema.Identity; +using Marten.Storage; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; @@ -44,15 +46,24 @@ options.UseSystemTextJsonForSerialization(EnumStorage.AsString); + options.Events.TenancyStyle = TenancyStyle.Conjoined; + options.Policies.AllDocumentsAreMultiTenanted(); + + options.Events.StreamIdentity = StreamIdentity.AsString; + options.Events.MetadataConfig.HeadersEnabled = true; + options.Events.MetadataConfig.CausationIdEnabled = true; + options.Events.MetadataConfig.CorrelationIdEnabled = true; + + options.Projections.Errors.SkipApplyErrors = false; options.Projections.Errors.SkipSerializationErrors = false; options.Projections.Errors.SkipUnknownEvents = false; - options.Projections.LiveStreamAggregation(); - options.Projections.Add(ProjectionLifecycle.Inline); - options.Projections.Add(ProjectionLifecycle.Inline); - options.Projections.Add(ProjectionLifecycle.Inline); - options.Projections.Add(ProjectionLifecycle.Async); + // options.Projections.LiveStreamAggregation(); + // options.Projections.Add(ProjectionLifecycle.Inline); + // options.Projections.Add(ProjectionLifecycle.Inline); + // options.Projections.Add(ProjectionLifecycle.Inline); + // options.Projections.Add(ProjectionLifecycle.Async); options.ApplicationAssembly = typeof(CustomerIncidentsSummaryProjection).Assembly; diff --git a/Sample/Helpdesk/Helpdesk.Api/docker-compose.yml b/Sample/Helpdesk/Helpdesk.Api/docker-compose.yml index 935fc9061..e646441b6 100644 --- a/Sample/Helpdesk/Helpdesk.Api/docker-compose.yml +++ b/Sample/Helpdesk/Helpdesk.Api/docker-compose.yml @@ -18,7 +18,7 @@ services: project_name: Helpdesk.Api run_codegen: true deploy: - replicas: 3 + replicas: 1 depends_on: postgres: condition: service_healthy diff --git a/Sample/MeetingsManagement/Readme.md b/Sample/MeetingsManagement/Readme.md index c59410379..b7a6faca8 100644 --- a/Sample/MeetingsManagement/Readme.md +++ b/Sample/MeetingsManagement/Readme.md @@ -15,9 +15,9 @@ 9. Open `MeetingsManagement.sln` solution. 10. Docker useful commands - - `docker-compose up` - start dockers - - `docker-compose kill` - to stop running dockers. - - `docker-compose down -v` - to clean stopped dockers. + - `docker compose up` - start dockers + - `docker compose kill` - to stop running dockers. + - `docker compose down -v` - to clean stopped dockers. - `docker ps` - for showing running dockers - `docker ps -a` - to show all dockers (also stopped) diff --git a/Workshops/BuildYourOwnEventStore/Readme.md b/Workshops/BuildYourOwnEventStore/Readme.md index 75f859619..ec5b1a840 100644 --- a/Workshops/BuildYourOwnEventStore/Readme.md +++ b/Workshops/BuildYourOwnEventStore/Readme.md @@ -39,13 +39,13 @@ and read: 10. Open `BuildYourOwnEventStore.sln` solution. 11. Docker useful commands - - `docker-compose up` - start dockers - - `docker-compose kill` - to stop running dockers. - - `docker-compose down -v` - to clean stopped dockers. + - `docker compose up` - start dockers + - `docker compose kill` - to stop running dockers. + - `docker compose down -v` - to clean stopped dockers. - `docker ps` - for showing running dockers - `docker ps -a` - to show all dockers (also stopped) -12. For the first part of workshop please go to [./docker](./docker) and run: `docker-compose up`. +12. For the first part of workshop please go to [./docker](./docker) and run: `docker compose up`. 13. Wait until all dockers got are downloaded and running. 14. You should automatically get: diff --git a/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/README.md b/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/README.md index 294263bbe..9c6a84d44 100644 --- a/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/README.md +++ b/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/README.md @@ -3,10 +3,10 @@ Using a defined structure of events from the [first exercise](../01-EventsDefinition), fill a `AppendEvents` function to store events in [Marten](https://martendb.io). ## Prerequisites -Run [docker-compose](../docker-compose.yml) script from the main workshop repository to start Postgres instance. +Run [docker compose](../docker-compose.yml) script from the main workshop repository to start Postgres instance. ```shell -docker-compose up +docker compose up ``` After that you can use PG Admin (IDE for Postgres) to see how tables and data look like. It's available at: http://localhost:5050. diff --git a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/README.md b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/README.md index 285fd9aca..b5c5a9b26 100644 --- a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/README.md +++ b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/README.md @@ -3,10 +3,10 @@ Using a defined structure of events from the [first exercise](../01-EventsDefinition), fill a `AppendEvents` function to store events in [EventStoreDB](https://developers.eventstore.com/clients/grpc/). ## Prerequisites -Run [docker-compose](../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. +Run [docker compose](../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. ```shell -docker-compose up +docker compose up ``` After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/. diff --git a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/README.md b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/README.md index 8e47ecacb..3befcd8f7 100644 --- a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/README.md +++ b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/README.md @@ -11,10 +11,10 @@ There are two variations: Select your preferred approach (or both) to solve this use case. If needed you can modify entities or events. ## Prerequisites -Run [docker-compose](../docker-compose.yml) script from the main workshop repository to start Postgres instance. +Run [docker compose](../docker-compose.yml) script from the main workshop repository to start Postgres instance. ```shell -docker-compose up +docker compose up ``` After that you can use PG Admin (IDE for Postgres) to see how tables and data look like. It's available at: http://localhost:5050. diff --git a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/README.md b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/README.md index 304ae4baf..ca759ccbb 100644 --- a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/README.md +++ b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/README.md @@ -11,10 +11,10 @@ There are two variations: Select your preferred approach (or both) to solve this use case. If needed you can modify entities or events. ## Prerequisites -Run [docker-compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. +Run [docker compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. ```shell -docker-compose up +docker compose up ``` After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/. diff --git a/Workshops/IntroductionToEventSourcing/README.md b/Workshops/IntroductionToEventSourcing/README.md index ecaacdf23..9dd4c2a71 100644 --- a/Workshops/IntroductionToEventSourcing/README.md +++ b/Workshops/IntroductionToEventSourcing/README.md @@ -58,7 +58,7 @@ Read also more in my article [Introduction to Event Sourcing - Self Paced Kit](h ## Running -1. Run: `docker-compose up`. +1. Run: `docker compose up`. 2. Wait until all dockers got are downloaded and running. 3. You should automatically get: - Postgres DB running for [Marten storage](https://martendb.io) diff --git a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/README.md b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/README.md index 3eb39d38e..8c9a1caf2 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/README.md +++ b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/README.md @@ -3,10 +3,10 @@ Using a defined structure of events from the [first exercise](../01-EventsDefinition), fill a `AppendEvents` function to store events in [Marten](https://martendb.io). ## Prerequisites -Run [docker-compose](../../docker-compose.yml) script from the main workshop repository to start Postgres instance. +Run [docker compose](../../docker-compose.yml) script from the main workshop repository to start Postgres instance. ```shell -docker-compose up +docker compose up ``` After that you can use PG Admin (IDE for Postgres) to see how tables and data look like. It's available at: http://localhost:5050. diff --git a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/README.md b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/README.md index db449e737..872511d4c 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/README.md +++ b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/README.md @@ -3,10 +3,10 @@ Using a defined structure of events from the [first exercise](../01-EventsDefinition), fill a `AppendEvents` function to store events in [EventStoreDB](https://developers.eventstore.com/clients/grpc/). ## Prerequisites -Run [docker-compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. +Run [docker compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. ```shell -docker-compose up +docker compose up ``` After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/. diff --git a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/README.md b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/README.md index 7bf07cc93..8352a28d5 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/README.md +++ b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/README.md @@ -11,10 +11,10 @@ There are two variations: Select your preferred approach (or both) to solve this use case. If needed you can modify entities or events. ## Prerequisites -Run [docker-compose](../../docker-compose.yml) script from the main workshop repository to start Postgres instance. +Run [docker compose](../../docker-compose.yml) script from the main workshop repository to start Postgres instance. ```shell -docker-compose up +docker compose up ``` After that you can use PG Admin (IDE for Postgres) to see how tables and data look like. It's available at: http://localhost:5050. diff --git a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/README.md b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/README.md index 017bfceed..2c590560a 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/README.md +++ b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/README.md @@ -11,10 +11,10 @@ There are two variations: Select your preferred approach (or both) to solve this use case. If needed you can modify entities or events. ## Prerequisites -Run [docker-compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. +Run [docker compose](../../docker-compose.yml) script from the main workshop repository to start EventStoreDB instance. ```shell -docker-compose up +docker compose up ``` After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/.