Apache Camel 文件队列需要 NOOP Consumer 的目录写入权限吗?
我在camel中配置了一个简单的NOOP文件使用者,如下所示:
file:///tst?delay=10000&idempotent=false&include=fileMatch&noop=true
通常运行camel应用程序的用户没有/tst的写入权限,但是有/tst/fileMatch的读写权限。不幸的是,我发现camel甚至不会轮询该文件,除非它具有对/tst的写权限。
有办法解决这个问题吗?
I have a simple NOOP file consumer configured in camel as follows:
file:///tst?delay=10000&idempotent=false&include=fileMatch&noop=true
Normally the user running the camel application will not have write permissions to /tst, however does have read and write permissions to /tst/fileMatch. Unfortunately I'm finding that camel won't even poll for the file unless it has write permissions to /tst.
Is there a way around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自上次回答以来,camel 文件组件发生了相关更改:
因此,在Camel 2.10或更高版本中,您仍然需要写权限才能使用readLock=fileLock。可以使用
readLock=none
,明显的效果是不会出现读锁。Since the last answer, the camel file component had a relevant change:
Hence, in Camel 2.10 or above, you still need write permission to use readLock=fileLock. You can use
readLock=none
, with the obvious impact that there will not be a read lock.当我这么累的时候,我不应该问问题。这不起作用的原因(如组件描述中明确所述)是默认的
readLock
策略是markerFile
(需要在目录中写入标记文件)。通过将其更改为 readLock=fileLock ,我不再需要目录的写权限来读取文件,因为文件系统锁已放置在正在读取的文件上。工作 URI 是:
I shouldn't ask questions when I'm this tired. The reason that this doesn't work (as clearly stated in the component description) is that the default
readLock
strategy ismarkerFile
(which needs to write the marker file in the directory). By changing this toreadLock=fileLock
I no longer need write permissions on the directory to read the file as the file system lock is placed on the file being read.The working URI is: