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

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

Apache 駱駝:停止交換進行 delete=true

Apache 駱駝:停止交換進行 delete=true

慕婉清6462132 2021-10-28 14:21:35
我只想允許從源目錄中刪除非重復文件。我有一條這樣的冪等消費者的路線:File repo = new File("repo.txt");IdempotentRepository fr = FileIdempotentRepository.fileIdempotentRepository(repo);from("sftp:someServer:somePort/someDir?delete=true")    .idempotentConsumer(header("CamelFileName"),fr)    .to("file:output");在這種情況下,delete=true 將導致從源目錄中刪除重復消息的路由。為了防止這種情況,我嘗試了以下代碼:File repo = new File("repo.txt");IdempotentRepository fr = FileIdempotentRepository.fileIdempotentRepository(repo);from("sftp:someServer:somePort/someDir?delete=true")    .idempotentConsumer(header("CamelFileName"),fr)    .skipDuplicate(false)    .filter(exchangeProperty(Exchange.DUPLICATE_MESSAGE).isEqualTo(true))        .process(new Processor() {            @Override            public void process(Exchange exchange) throws Exception {                exchange.setException(new InterruptedException("Cancel Exchange"));                exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);            }         })    .end().to("file:output");由于從路由內的 sftp 刪除將需要另一個 jsch 實例,因此我希望能夠使用 sftp 使用者的刪除屬性
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 230 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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