使用 Apache Camel 从 samba 位置路由读取文件

Reading a file using Apache Camel route from samba location

提问人:Naveen 提问时间:9/28/2023 更新时间:9/28/2023 访问量:50

问:

我正在尝试使用route ver:从spring boot从samba位置复制文件。org.apache.camel2.18.01.5.10.RELEASE

我的文件上有以下桑巴位置。application.yml

smb://USER;username@sambahost/folder1/folder2/folder3?password=123456&initialDelay=30000&delay=300000&delete=true&readLock=changed

这曾经正常工作,我们的基础架构团队最近将 sambahost 从 NetApp 存储设备迁移到 Windows 文件共享,但它停止了工作。

我可以看到这不是访问问题,因为我能够手动连接并且它可以工作。

naveenp@LTIN123456:~$ smbclient //sambahost/folder1/ -D folder2/folder3 -U username@sambahost -m SMB2
Password for [username@sambahost]:
Try "help" to get a list of possible commands.
smb: \folder2\folder3\> ls
  .                                   D        0  Wed Sep 27 17:29:23 2023
  ..                                  D        0  Wed Sep 27 17:29:23 2023
  File09-27-2023_03-09-04.csv      A   479638  Wed Sep 27 12:30:22 2023

                129184287 blocks of size 65536. 23724791 blocks available
smb: \folder2\folder3\>

这是我尝试从 Samba 位置获取文件时遇到的错误。

Consumer Consumer[smb://USER;username@sambahost/folder1/folder2/folder3?delay=300000&delete=true&initialDelay=30000&password=xxxxxx&readLock=changed] failed polling endpoint: smb://USER;username@sambahost/folder1/folder2/folder3?delay=300000&delete=true&initialDelay=30000&password=xxxxxx&readLock=changed. 
Will try again at next poll. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Could not get files Failed to connect: sambahost/10.100.100.123]
org.apacheextras.camel.component.jcifs.SmbConsumer","thread_name":"Camel (com.example.app.consumerApp) thread #0 - smb://USER;username@sambahost/folder1/folder2/folder3
org.apache.camel.component.file.GenericFileOperationFailedException: Could not get files Failed to connect: sambahost/10.100.100.123
 org.apacheextras.camel.component.jcifs.SmbOperations.listFiles(SmbOperations.java:350)
 org.apacheextras.camel.component.jcifs.SmbConsumer.pollDirectory(SmbConsumer.java:59)
 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:132)
 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)\r\n
Caused by: jcifs.smb.SmbException: Failed to connect: sambahost/10.100.100.123
 jcifs.smb.SmbTransport.connect(SmbTransport.java:309)
 jcifs.smb.SmbTree.treeConnect(SmbTree.java:156)
 jcifs.smb.SmbFile.doConnect(SmbFile.java:911)
 jcifs.smb.SmbFile.connect(SmbFile.java:954)
 jcifs.smb.SmbFile.connect0(SmbFile.java:880)
 jcifs.smb.SmbFile.resolveDfs(SmbFile.java:669)
 jcifs.smb.SmbFile.send(SmbFile.java:773)
 jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1986)
 jcifs.smb.SmbFile.doEnum(SmbFile.java:1738)
 jcifs.smb.SmbFile.listFiles(SmbFile.java:1715)
 jcifs.smb.SmbFile.listFiles(SmbFile.java:1648)
 org.apacheextras.camel.component.jcifs.DefaultSmbClient.listFiles(DefaultSmbClient.java:161)
 org.apacheextras.camel.component.jcifs.SmbOperations.listFiles(SmbOperations.java:346)

提前非常感谢您在这方面的帮助。

spring-boot apache-camel samba camel-routes

评论


答: 暂无答案