olegz/spring-integration — comment on commit b18ab7cd082f669d8da4a1e702330bb4f9ab52a4
File: spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java line 139
By garyrussell:

An interesting problem, and one that's not entirely solvable. It is particularly difficult problem when firewalls are involved.

There are a couple of things you can do...

1. Provide a property so they can override your default.
2. Use a similar technique to the one I used for the builds for the tcp tests, where I look for an available port between x and x+200. If you go that route, you should probably document that they need to open x through x+200 on the firewall (many orgs don't like opening port ranges 'just in case'. See SocketTestUtils.findAvailableServerSocket(). Even that is not perfect because some other process can steal a port between the test and when we start listening.

I would probably go with #1. I would definitely NOT hard code a default with no means to override.

G.