Julio
Julio

Reputation: 41

Apache Camel FTP Client Concurrency

I'm having a problem.

I have an application that I'm deploying twice in two different servers, this application uses the ftp component:

<from uri="ftp://..." />

As I'm deploying it twice (Like this) I'm having concurrency and some files in FTP server are being processed twice or are throwing exceptions (FileNotFoundException) when the other Node process it first.

Is there any solution for this?

Thx.

Upvotes: 1

Views: 378

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55750

Yes you can look at setting up those FTP routes in master/slave mode, so only one of them is active at any time. Or you can use a shared idempotent repository as a "lock" so they can only grab a file if they can get an exclusive lock from that repo.

Its covered in the Camel in Action book chapter 17, and chapter 12 as well.

And you can find some details on the Camel website, however not as good docs as the book.

Upvotes: 1

Related Questions