簡體   English   中英

在WSO2中將事務介體與克隆介體一起使用

[英]Using transaction mediator in WSO2 with clone mediator

在閱讀SO中的幾個問題后,我對WSO2有2個與交易中介相關的問題:

  1. 如何在WSO2 ESB中跨序列管理事務
  2. WSO2 ESB分布式事務
  3. 在WSO2 ESB 4.7.0中,我們可以按接收順序進行JMS回滾嗎?

我的問題:

  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>
  1. 不幸的是,在WSO2的當前實現中,ESB不支持將事務介體與克隆介體一起使用。

  2. 當前,wso2 esb與事務調解器一起使用,可以與dbreport調解器一起使用,在那里您可以像正確提到的那樣“ useTransaction =“ true”。除此之外,您只能將事務與調解器一起用於JMS使用者/生產者方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM