future

future


基本代码结构

<h2>所有项目的事件调用流程基本都是 从 kafka 作为消费者 接收消息</h2> <p>接收的消息作为事件类型,</p> <p>Consumer --&gt; EventProducer(事件转化器,事件分发中心) --&gt; Handler方法的OnEvent方法</p> <p>--&gt; 调用Service对象 --&gt; 调用ServiceImpl --&gt; 具体的业务逻辑在ServiceImpl方法中实现</p> <p>EventProducer :使用Disruptor框架的事件生产者类,主要用于将业务数据对象发布到Disruptor的环形缓冲区(RingBuffer)中</p> <p>在Springboot启动的时候创建了一个名为 disruptor的Disruptor实例,用于实现高性能事件处理</p> <p>disruptor</p> <p>.handleEventsWith(liquidateSnapshotHandler)</p> <p>.then(liquidateCheckHandler).then(liquidateRiskHandler)</p> <p>.then(liquidateEmitHandler)</p> <p>.then(liquidateCleanHandler);</p> <p>这段代码是 配置Disruptor的事件处理流水线,用于指定事件的处理顺序</p>

页面列表

ITEM_HTML