A ticket booking system - based on SOA principles.
This demo aims to demonstrate how to use sagas to overcome the architectural limitations of Process Managers in distributed systems. This is the support demo of my Welcome to the (state) machine talk.
The demo assumes some knowledge of service boundaries
and the role of ViewModel Composition
in SOA-based systems. I recommend watching the following 2 talks to learn more about figuring out service boundaries and dealing with UI/ViewModel aspects in a microservices/SOA system without reintroducing coupling by making requests/responses between the services.
- Finding your service boundaries - a practical guide by @adamralph
- All Our Aggregates Are Wrong by @mauroservienti (myself)
An exhaustive dissertation about ViewModel Composition
is available on my blog in the ViewModel Composition series.
The following requirements must be met to run the demos successfully:
- Visual Studio Code and the Dev containers extension.
- Docker must be pre-installed on the machine.
- The repository
devcontainer
setup requiresdocker-compose
to be installed on the machine.
- Clone the repository
- On Windows, make sure to clone on a short path, e.g.,
c:\dev
, to avoid any "path too long" error
- On Windows, make sure to clone on a short path, e.g.,
- Open one of the demo folders in Visual Studio Code
- Make sure Docker is running
- If you're using Docker for Windows with Hyper-V, make sure that the cloned folder, or a parent folder, is mapped in Docker
- Open the Visual Studio Code command palette (
F1
on all supported operating systems, for more information on VS Code keyboard shortcuts, refer to this page) - Type
Reopen in Container
, the command palette supports auto-completion; the command should be available by typingreop
Wait for Visual Studio Code Dev containers extension to:
- download the required container images
- configure the docker environment
- configure the remote Visual Studio Code instance with the required extensions
Note: no changes will be made to your Visual Studio Code installation; all changes will be applied to the VS Code instance running in the remote container
The repository devcontainer
configuration will:
- One or more container instances:
- One RabbitMQ instance with management plugin support
- One .NET-enabled container where the repository source code will be mapped
- A few PostgreSQL instances
- Configure the VS Code remote instance with:
- The C# extension (
ms-dotnettools.csharp
) - The PostgreSQL Explorer extension (
ckolkman.vscode-postgres
)
- The C# extension (
Once the configuration is completed, VS Code will show a new Ports
tab in the bottom-docked terminal area. The Ports
tab will list all the ports the remote containers expose.
The default RabbitMQ credentials are:
- Username:
guest
- Password:
guest
The default PostgreSQL credentials are:
- User:
db_user
- Password:
P@ssw0rd
To execute the demo, open the root folder in VS Code, press F1
, and search for Reopen in container
. Wait for the Dev Container to complete the setup process.
Once the demo content has been reopened in the dev container:
- Press
F1
, search forRun task
, and execute the desired task to build the solution or to build the solution and deploy the required data - Go to the
Run and Debug
VS Code section and select the command you want to execute.
This demo is built using NServiceBus Sagas; I work for Particular Software, the makers of NServiceBus.