I have 2 questions to WSO2 related to the transaction mediator after read several question in SO like:
- 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?
My questions:
Can I use transaction to ssupport the clone mediator? Like I clone a message and send to several sequences, if some sequence produce an error I do a rollback?
All the wso2 samples I see related to transaction mediator use the dbreport mediator, and in this mediator I can specified "useTransaction="true"", can I do the same to another mediators?
For example, in question 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>