官术网_书友最值得收藏!

How it works...

In this recipe, we implement a command function called submit that would be part of a Backend For Frontend service. Following the Event Sourcing pattern, we make this command atomic by only writing to a single resource. In some scenarios, such as initiating a long-lived business process or tracking user clicks, we only need to fire-and-forget. In these cases, the event-first variant is most appropriate. The command just needs to execute quickly and leave as little to chance as possible. We write the event to the highly available, fully-managed cloud-native event stream and trust that the downstream services will eventually consume the event.

The logic wraps the domain object in the standard event format, as discussed in the Creating an event stream and publishing an event recipe in Chapter 1Getting Started with Cloud-Native. The event type is specified, the domain object ID is used as the partitionKey, and useful tags are adorned. Finally, the event is written to the stream specified by the STREAM_NAME environment variable.

主站蜘蛛池模板: 巴彦淖尔市| 逊克县| 寿阳县| 吉安市| 金平| 崇信县| 新乡市| 锡林郭勒盟| 巴青县| 璧山县| 靖宇县| 叶城县| 镇原县| 来凤县| 班戈县| 永济市| 高邮市| 闵行区| 内黄县| 湖南省| 贺州市| 湄潭县| 页游| 武夷山市| 南漳县| 普定县| 庆城县| 高台县| 丹寨县| 电白县| 平凉市| 安化县| 仁布县| 新田县| 晋州市| 垣曲县| 万山特区| 肥东县| 于田县| 林芝县| 图们市|