亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從 jdbc-inbound-channel-adapter 捕獲異常?

如何從 jdbc-inbound-channel-adapter 捕獲異常?

飲歌長嘯 2022-05-25 10:49:22
是否可以從jdbc-inbound-channel-adapter(例如查詢執行期間的數據庫問題)捕獲異常?例如,http-outbound-gateway可以使用帶有error-handler屬性聲明的錯誤處理程序。謝謝你的建議。
查看完整描述

1 回答

?
慕容708150

TA貢獻1831條經驗 獲得超4個贊

Ajdbc-inbound-channel-adapter完全基于“硬”輪詢邏輯JdbcPollingChannelAdapter及其包裝器。SourcePollingChannelAdapter


我很確定您已經<poller>為提到的jdbc-inbound-channel-adapter或全局提供了配置。


那個有這個選項:


   <xsd:attribute name="error-channel" type="xsd:string">

        <xsd:annotation>

            <xsd:documentation><![CDATA[

                Identifies channel that error messages will be sent to if a failure occurs in this

                poller's invocation. To completely suppress Exceptions, provide a

                reference to the "nullChannel" here.

            ]]></xsd:documentation>

        </xsd:annotation>

    </xsd:attribute>

因此,當輪詢 DB 期間出現一些錯誤時,它將被包裝到 anErrorMessage并發送到已配置的error-channel. 如果未提供,則將使用全局errorChannelbean。


有關詳細信息,請參閱參考手冊中的錯誤處理章節:https ://docs.spring.io/spring-integration/docs/current/reference/html/configuration.html#namespace-errorhandler


查看完整回答
反對 回復 2022-05-25
  • 1 回答
  • 0 關注
  • 92 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號