Guildencrantz
Guildencrantz

Reputation: 1915

Apache Camel File Queue Requires Directory Write Permissions For NOOP Consumer?

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?

Upvotes: 2

Views: 2044

Answers (2)

cmonkey
cmonkey

Reputation: 4296

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.

Upvotes: 3

Guildencrantz
Guildencrantz

Reputation: 1915

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

Upvotes: 2

Related Questions