我需要不断更新循环中的表,并且大部分时间都可以正常运行,但偶尔Mule会更新表但是没有提交。
所以,这是我的流程。我轮询一个标志为0的表。一旦轮询,标志设置为5.调用服务后,标志设置为1.但是如果服务调用失败,则标志设置回0以便它#&# 39;将被重新轮询和处理。
如果服务停止了几分钟,那么这个循环应该继续运行直到服务启动。下面的陈述大部分都很好,但有时它不会更新,循环也会被破坏。
不确定是Mule还是DriverManager问题。
<jdbc-ee:outbound-endpoint queryTimeout="-1" queryKey="updateEventReset" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
流速:
<mule>
<spring:bean id="jdbcEASDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
</spring:bean>
<jdbc-ee:connector dataSource-ref="jdbcEASDataSource" name="DatabaseEvents" transactionPerMessage="true" validateConnections="true" queryTimeout="-1" pollingFrequency="10000" doc:name="Database">
<receiver-threading-profile maxThreadsActive="1"/>
<jdbc-ee:query key="selectEvent" value="select * from EVENT_TEST where PROCESSED = 0 ORDER BY RowId" />
<jdbc-ee:query key="selectEvent.ack" value="update EVENT_TEST set PROCESSED = 5 where RowId = #[map-payload:ROWID]" />
<jdbc-ee:query key="updateEventProcessed" value="update EVENT_TEST set PROCESSED = 1 where RowId = #[flowVars['RowId']]" />
<jdbc-ee:query key="updateEventReset" value="update EVENT_TEST set PROCESSED = 0 where PROCESSED = 5" />
</jdbc-ee:connector>
<flow name="EventLinkerDBPolling" doc:name="EventLinkerDBPolling" processingStrategy="synchronous">
<jdbc-ee:inbound-endpoint queryKey="selectEvent" connector-ref="ISeriesDatabaseEvents" doc:name="ACSC Database"/>
<vm:outbound-endpoint path="vm.toEventWSCall" exchange-pattern="one-way" doc:name="To Event Dining" />
</flow>
<flow name="EventWSProcessing" doc:name="EventWSProcessing" processingStrategy="synchronous">
<vm:inbound-endpoint path="vm.toEventWSCall" exchange-pattern="one-way" doc:name="Event " >
<vm:transaction action="NONE"/>
</vm:inbound-endpoint>
<set-variable variableName="RowId" value="#[map-payload:ROWID]" doc:name="Variable"/>
<flow-ref name="ManagerClient" doc:name="Call Flow Linker" />
<jdbc-ee:outbound-endpoint queryKey="updateEventProcessed" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<choice doc:name="Choice">
<when expression="#[ payload.getStatusCode() == 404 ]">
<processor-chain>
<jdbc-ee:outbound-endpoint queryTimeout="-1" queryKey="updateEventReset" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
</processor-chain>
</when>
</choice>
</catch-exception-strategy>
</flow>
</mule>
答案 0 :(得分:0)
我遇到了类似的问题,问题结果是内部的Mule异常。 https://www.mulesoft.org/jira/browse/MULE-6889
我无法在你的流程中看到foreach循环。你是怎么循环的? 此异常对于每个循环都非常具体。通过重组流程,我可以相对容易地进行排序(经过数周的故障排除)