the PriceDropController is now part of the ProductsService. I introduced a simple unit of work and async factory that encapsulate ADO.NET for SQL Server and In-Memory data. This allows access to the database in a completely asynchronous manner while keeping the business logic in the controller completely decoupled from any specific data access technology.
I found out that, when sending events, Dapr provides no guarantee that the event will actually reach the message broker (e.g. when the message broker is down). Dapr only ensures at-least-once semantics when messages are routed to the subscriber (see https://github.com/dapr/dapr/issues/4233). I therefore implemented the Transactional Outbox pattern when the price-drop event is published by the PriceDropController.
I moved the PriceWatcherController with its Register endpoint to the PriceDropNotifier service. It currently uses an in-memory data access layer with a simplified Unit-of-Work pattern to store registrations.
The PriceDropNotifierController now fetches all registrations and sends emails accordingly.
I removed the PriceWatcher service completely, updated the gateway routing config and removed all corresponding entries from IAC and the GitHub workflows.
Issues I still have:
I couldn't test the changes to GitHub workflows and IAC - maybe we should review them together? I don't think it's currently easy to setup a new environment where such infrastructure changes can be tested in isolation.
This PR contains the following changes:
PriceDropController
is now part of theProductsService
. I introduced a simple unit of work and async factory that encapsulate ADO.NET for SQL Server and In-Memory data. This allows access to the database in a completely asynchronous manner while keeping the business logic in the controller completely decoupled from any specific data access technology.PriceDropController
.PriceWatcherController
with itsRegister
endpoint to the PriceDropNotifier service. It currently uses an in-memory data access layer with a simplified Unit-of-Work pattern to store registrations.PriceDropNotifierController
now fetches all registrations and sends emails accordingly.Issues I still have: