0
回滚事务不起作用。Apache Camel和Apache ActiveMQ中的XA事务
我试图设置在豆ActiveMQComponent
参数:
cacheLevelName
=>CACHE_CONSUMER
transacted
=>true
如何解决这个错误?
登录:
[ad #8 - JmsConsumer[Caosqueue]] TransactionErrorHandler WARN Transaction rollback (0x67756120) redelivered(false) for (MessageId: ID:stws2327-61437-1452674698638-1:3:1:1:1 on ExchangeId: ID-stws2327-61436-1452674698403-0-3) due exchange was marked for rollbackOnly
[ad #8 - JmsConsumer[Caosqueue]] EndpointMessageListener WARN Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - org.apache.camel.RollbackExchangeException: Intended rollback. Exchange[Message: two]]
路线:
<!-- Next route-->
<route autoStartup="true" errorHandlerRef="myErrorHandler" id="OperDayRoute">
<from uri="jms:Caosqueue?transacted=true" />
<transacted ref="PROPAGATION_REQUIRED" />
<setHeader headerName="body">
<simple>${body}</simple>
</setHeader>
<to uri="sql:{{sql.insertBody}}"/>
<convertBodyTo type="java.lang.String" />
<choice>
<when>
<simple>${headers.CamelSqlUpdateCount} != 1</simple>
<log message="PROCESSING RESULT IS ${body} - OK" />
</when>
<otherwise>
<log message="PROCESSING RESULT IS ${body} - NO OK!" />
<camel:rollback markRollbackOnly="true" />
<throwException ref="IllegalRez" />
</otherwise>
</choice>
</route>
https://github.com/Dugayoyo/camel/blob/master/context - 完整的上下文。并记录当我运行这个 - https://github.com/Dugayoyo/camel/blob/master/log –
如果你正在使用XA事务,那么你应该禁用本地JMS事务在骆驼端点(即transacted = false),因为它将是启动XA事务的XA连接工厂本身。此外,您在配置中缺少XA资源管理器:https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/XaJms-Sample.html。 – raulk