【问题标题】:migrating jdbc transport to database connector in mule 3.7在 mule 3.7 中将 jdbc 传输迁移到数据库连接器
【发布时间】:2015-12-10 16:17:45
【问题描述】:

目前我们正在使用已弃用的 jdbc 连接器,它是相应的 jdbc 入站端点来轮询数据库中的数据。

我们正在使用 .ack(确认 (ACK) 语句功能)来防止处理重复记录。

但是,我似乎没有发现使用新的数据库连接器具有相同的功能。我们使用的是 Mule 社区版,因此无法使用批处理组件。

是否有可能使用数据库连接器(结合轮询组件)获得相同的功能。还是我们必须手动确认我们的记录?

<jdbc:connector name="dbPollingConnector" dataSource-ref="dataSource" queryTimeout="1000" pollingFrequency="1000">
        <receiver-threading-profile maxThreadsActive="1" />
        <reconnect-forever frequency="60000"></reconnect-forever>
        <jdbc:query key="newDataGrouped"   value="select * from table where processed = 0"></jdbc:query>
        <jdbc:query key="newDataGrouped.ack"  value="update table set processed = current_timestamp"></jdbc:query>
</jdbc:connector>

<flow name="flowName">

      <jdbc:inbound-endpoint name="groupedInboundComponent" responseTimeout="1000" queryTimeout="100"
                pollingFrequency="1000" connector-ref="dbPollingConnector" queryKey="newDataGrouped" exchange-pattern="request-response">
      </jdbc:inbound-endpoint>

      <!--... rest of the flow ... -->

</flow>

【问题讨论】:

    标签: mule


    【解决方案1】:

    您可以使用Polling for Updates using Watermarks

    它的工作方式与 .ack 略有相似,但不修改数据库中的物理数据。我认为它只需要在当前查询中进行细微修改,例如:select * from table where id &gt; #[flowVars['lastModifiedID']]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-21
      • 2018-07-29
      • 1970-01-01
      相关资源
      最近更新 更多