【问题标题】:Using transaction mediator in WSO2 with clone mediator在 WSO2 中使用事务中介和克隆中介
【发布时间】:2016-09-26 16:56:15
【问题描述】:

在阅读了 SO 中的几个问题后,我对 WSO2 有 2 个与事务中介相关的问题,例如:

  1. How to Manage Transaction across sequences in WSO2 ESB
  2. WSO2 ESB Distributed Transations
  3. In WSO2 ESB 4.7.0 can we do JMS rollback in receiving sequence?

我的问题:

  1. 我可以使用事务来支持克隆中介吗?就像我克隆一条消息并发送到多个序列一样,如果某个序列产生错误我会回滚吗?

  2. 我看到的所有与事务中介器相关的 wso2 样本都使用 dbreport 中介器,在这个中介器中我可以指定“useTransaction="true"”,我可以对其他中介器做同样的事情吗?

例如问题1:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="proxy1"
       transports="https,http"
       statistics="enable"
       trace="enable"
       startOnLoad="true">
   <target>
      <inSequence onError="conf:/secuencias/rollbackSequence">
         <transaction action="new"/>
         <clone sequential="true">
            <target sequence="anon">
               <sequence>
                  <payloadFactory media-type="xml">
                     ....
                  </payloadFactory>
                  <send>
                     <endpoint>
                        <address uri="..."/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
            <target sequence="anon">
               <sequence>
                  <payloadFactory media-type="xml">
                    ....
                  </payloadFactory>
                  <send>
                     <endpoint>
                        <address uri="..."/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
            <target sequence="anon">
               <sequence>
                  <payloadFactory media-type="xml">
                    ....
                  </payloadFactory>
                  <send>
                     <endpoint>
                        <address uri="..."/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </clone>
         <transaction action="commit"/>
      </inSequence>
      <outSequence>
         <aggregate>
            <completeCondition timeout="5">
               <messageCount min="3" max="3"/>
            </completeCondition>
            <onComplete xmlns:ns="http://org.apache.synapse/xsd"
                        xmlns:p="http://sistema1.empresa1.com"
                        expression="//p:GeneratedKeys/Entry/ID">
               <payloadFactory media-type="xml">
                    ....
               </payloadFactory>
               <send/>
            </onComplete>
         </aggregate>
      </outSequence>
      <faultSequence>
         <transaction action="rollback"/>
         <send/>
      </faultSequence>
   </target>
   <publishWSDL key="conf:/wsdls/....wsdl"/>
   <description/>
</proxy>

【问题讨论】:

  • 豪尔赫,你想出这个了吗?在开发跨多个代理和序列的解决方案时,我们在这里也遇到了相同类型的事务问题。

标签: transactions wso2 wso2esb


【解决方案1】:
  1. 不幸的是,当前的 WSO2 ESB 实现不支持将事务中介与克隆中介​​一起使用。

  2. 目前 wso2 esb 与事务调解器一起使用以与 dbreport 调解器一起使用,在那里您可以“useTransaction="true" 正如您正确提到的那样。除此之外,您可以将事务与事务调解器一起用于 JMS 消费者/生产者仅限场景。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-08
    • 1970-01-01
    • 2012-08-31
    • 2012-08-31
    • 1970-01-01
    相关资源
    最近更新 更多