Error handling Mule ESB:什么;Jms会话应进行事务处理;方法

Error handling Mule ESB:什么;Jms会话应进行事务处理;方法,error-handling,mule,esb,rollback,Error Handling,Mule,Esb,Rollback,快速、直截了当的方法 我正在测试JMS订阅流中的重试逻辑。这是投掷 org.mule.transaction.IllegalTransactionStateException: Jms session should be transacted 测试正在使用JMS ActiveMQ的管理接口(localhost:8161/admin/topic)完成,该接口向主题[流正在订阅]发送消息 问题: 抛出错误是否是由于某些原因造成的 配置正确吗?或 默认情况下,使用ActiveMQ的“发送到”提交消息

快速、直截了当的方法

我正在测试JMS订阅流中的重试逻辑。这是投掷

org.mule.transaction.IllegalTransactionStateException: Jms session should be transacted
测试正在使用JMS ActiveMQ的管理接口(localhost:8161/admin/topic)完成,该接口向主题[流正在订阅]发送消息

问题:

  • 抛出错误是否是由于某些原因造成的 配置正确吗?或
  • 默认情况下,使用ActiveMQ的“发送到”提交消息是 非事务性会话?如何使其“交易”
  • 详细[更长]的解释

    流有一个JMS端点(设置为持久客户端)作为消息源;此外,流程配置为“多资源事务”类型;并且具有“回滚异常策略”。 故意将流配置为抛出SQL错误(在主键列中插入固定值),并且“回滚异常策略”记录消息

    以下是流程:

    --编辑:以及JMS连接配置

    ...
        <jms:activemq-connector name="PasswordResetTuT_Durable_Client_ACK_MQ" brokerURL="tcp://localhost:61616?keepAlive=true" validateConnections="true" clientId="PASSWORDRESET" doc:name="Active MQ" durable="true" maxRedelivery="5" >
            <reconnect frequency="7000" count="30"/>
        </jms:activemq-connector>
    ...
        <flow name="PASSWORDRESET-TUT.RequestConfirmation" processingStrategy="synchronous">
            <jms:inbound-endpoint topic="/passwordreset-tut/requestConfirmation" connector-ref="PasswordResetTuT_Durable_Client_ACK_MQ" durableName="PASSWORDRESET-TUT.RequestConfirmationDurableClientName" doc:name="JMS">
                <ee:multi-transaction action="ALWAYS_BEGIN" timeout="15000"/>
            </jms:inbound-endpoint>
            <!-- ...
                    some processing goes here ...
                                                  -->
            <expression-component doc:name="Expression"><![CDATA[flowVars.token="123456789ABCDEF";]]></expression-component>
            <db:insert config-ref="PasswordReset_Database_Configuration" doc:name="Insert into TOKEN">
                <db:parameterized-query>
                    <!-- an insert statement that, due to the 
                         expression-component above, will attempt to 
                         insert a duplicate value into a primary key -->
                </db:parameterized-query>
            </db:insert>
            <!-- ...
                    some processing goes here ...
                                                  -->
            <logger message="Finished confirming #[flowVars.token]." level="INFO" doc:name="Logger"/>
            <rollback-exception-strategy maxRedeliveryAttempts="5" doc:name="Rollback Exception Strategy">
                <logger message="Exception throw. Attempting redelivery #[(message.inboundProperties.JMSRedelivered==false)?1:message.inboundProperties.JMSXDeliveryCount+1] for message #[message.outboundAttachments.JMSMessageID]." level="INFO" doc:name="Logger"/>
                <on-redelivery-attempts-exceeded>
                    <logger message="Redelivery exhausted. Sending #[message.inboundProperties.JMSMessageID] to DLQ." level="INFO" doc:name="Logger"/>
                    <jms:outbound-endpoint topic="/passwordreset-tut/DLQ/requestConfirmation" connector-ref="PasswordResetTut_MQ" doc:name="JMS"/>
                </on-redelivery-attempts-exceeded>
            </rollback-exception-strategy>
        </flow>
    ...
    
    。。。
    ...
    ...
    
    第一次“测试尝试”是使用ActiveMQ的“发送到”[topic](主题)完成的:它抛出所提到的错误


    现在,还不清楚(至少对我来说)(1)该问题是由我用来测试它的方法引起的,还是(2)它是由[流中]的一些错误配置引起的。

    我认为这可能与需要设置ActiveMQ连接器的事务类型有关,如果您有重试策略,则它必须是一个事务,以便保存该事务并可以重试。在消息流中,如果单击JMS连接器,您应该在队列和主题设置下面看到事务设置。对于所有入站JMS,应将其设置为始终开始,对于JMS入站之后的任何出站,应将其设置为始终加入。

    添加
    密码重置设置的配置\u持久\u客户端\u确认\u MQ
    help@Petter:
    PasswordResetTuT\u Durable\u Client\u ACK\u MQ
    的配置已添加到文本中。谢谢你提出这个。