簡體   English   中英

Mule JDBC更新間歇性地工作

[英]Mule JDBC update works intermittently

我需要不斷地循環更新一個表,大多數情況下它都能正常工作,但有時Mule會更新表,但未提交。

所以,這是我的流程。 我輪詢一個標志為0的表。一旦對其進行輪詢,則將標志設置為5。調用服務后,將標志設置為1。但是,如果服務調用失敗,則將標志設置回0,以便將其設置為0。將重新輪詢和處理。

如果服務關閉了幾分鍾,則此循環應繼續進行直到服務啟動。 下面的語句在大多數情況下都可以正常工作,但是有時它不會更新並且循環中斷。

不確定是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>

我有一個類似的問題,結果證明是內部Mule異常。 https://www.mulesoft.org/jira/browse/MULE-6889

我看不到流程中的foreach循環。 您如何循環播放? 對於每個循環,此異常是非常特定的。 通過重組流程,我可以相對容易地進行分類(經過數周的故障排除)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM