msgBroker

特点

可靠性非常高。主要用于事物系统调用的解耦合。远离是标准2PC+回查。
msgBroker直接使用mysql作为本地持久化。
采用推的模式。
支持事物。

msgBroker

最大的缺点是消息积压会导致内存崩溃。

发布者示例配置如下

<sofa:publisher id="uniformEventPublisher" group="P_appname_service">
  <sofa:channels>
    <sofa:channel value="TP_DEFAULT"/>
  </sofa:channels>
  <sofa:binding.msg_broker/>
</sofa:publisher>

消费者示例配置如下

<sofa:consumer id="consumerService" group="S_appname_service">
  <sofa:listener ref="uniformEventMessageListener"/>
  <sofa:channels>
    <sofa:channel value="TP_DEFAULT">
      <sofa:event eventType="direct" eventCode="EC_DEFAULT" persistence="true"/>
    </sofa:channel>
  </sofa:channels>
  <sofa:binding.msg_broker/>
</sofa:consumer>

<bean id="uniformEventMessageListener" class="com.alipay.example.UniformEventMessageListenerImpl"/