drz5553 2019-07-17 08:20
浏览 50

CQRS / ES - 拉动“未处理”事件

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

  1. UI --> AddObjectCommand -> ObjectAddedEvent
  2. Projector (listens the ObjectAddedEvent to project it - update of the denormalized read model - Showing AR status through UI such as 'Addition has been scheduled'...)
  3. 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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看