Good morning,
I've one bounded context which requires two sides, a frontend side and a backend side. The frontend side MUST be made available through a Web server to allow a user to send commands sush as AddObjectCommand, ChangeObjectCommand, DeleteObjectCommand... However, because the Web server is run through a unprivileged unix user, the tasks MUST be delegated to the backend side, which can operates on the filesystem with highter privileges.
Right now, the flow looks as follows:
Frontend side
- UI --> AddObjectCommand -> ObjectAddedEvent
- Projector (listens the ObjectAddedEvent to project it - update of the denormalized read model - Showing AR status through UI such as 'Addition has been scheduled'...)
- Processor (listens to the ObjectAddedEvent to send a request to a daemon which in turn, executes the backend side)
It must be noted that the daemon is based on a SMTP-like protocol, and that it is not able to receive domain messages (events), nor to make acknowledgement of them... The processor on the frontend side can only know if the request succeeded or not.
Backend side
The backend SHOULD somehow react to the ObjectAddedEvent event to operate accordingly and then, once done, publish the ObjectConfiguredEvent event, or another event in case of failure... It SHOULD also update the read model through its own projector.
The problem I'm facing here is that of course, the backend doesn't receive the domain messages (events). It is just another process (script) that's launch by the daemon.
Question
Should I, and if yes, how can I pull unprocessed events from the event store from the backend side? If not, should I just query the read model only, then execute specific commands from the backend (through a SAGA)?
Thank you.