Apache Camel 文件队列需要 NOOP Consumer 的目录写入权限吗?

发布于 2024-11-16 00:02:21 字数 263 浏览 1 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沐歌 2024-11-23 00:02:21

自上次回答以来,camel 文件组件发生了相关更改:

从 Camel 2.10 开始,读取锁已更改,fileLock
重命名还将也使用markerFile,以确保不会拾取
运行在其他 Camel 上的消费者可能正在处理的文件
另一个节点(例如集群)。仅此文件支持
组件(不是 ftp 组件)。

因此,在Camel 2.10或更高版本中,您仍然需要写权限才能使用readLock=fileLock。可以使用readLock=none,明显的效果是不会出现读锁。

Since the last answer, the camel file component had a relevant change:

Notice from Camel 2.10 onwards the read locks changed, fileLock and
rename will also use a markerFile as well, to ensure not picking up
files that may be in process by another Camel consumer running on
another node (eg cluster). This is only supported by the file
component (not the ftp component).

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.

独自唱情﹋歌 2024-11-23 00:02:21

当我这么累的时候,我不应该问问题。这不起作用的原因(如组件描述中明确所述)是默认的readLock策略是markerFile(需要在目录中写入标记文件)。通过将其更改为 readLock=fileLock ,我不再需要目录的写权限来读取文件,因为文件系统锁已放置在正在读取的文件上。

工作 URI 是:

file:///tst?delay=10000&idempotent=false&include=fileMatch&noop=true&readLock=fileLock

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 is markerFile (which needs to write the marker file in the directory). By changing this to readLock=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:

file:///tst?delay=10000&idempotent=false&include=fileMatch&noop=true&readLock=fileLock
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文