【发布时间】:2016-09-26 16:56:15
【问题描述】:
在阅读了 SO 中的几个问题后,我对 WSO2 有 2 个与事务中介相关的问题,例如:
- How to Manage Transaction across sequences in WSO2 ESB
- WSO2 ESB Distributed Transations
- In WSO2 ESB 4.7.0 can we do JMS rollback in receiving sequence?
我的问题:
我可以使用事务来支持克隆中介吗?就像我克隆一条消息并发送到多个序列一样,如果某个序列产生错误我会回滚吗?
-
我看到的所有与事务中介器相关的 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