-
1. Re: FTP Listener and number of connections that are opened
nl Oct 20, 2009 5:06 AM (in response to garuda)One point is, that the RemoteGatewayListener is doing a real login within its init phase (see checkMyParms()):
RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
Is this really needed? Wouldn't it be better to make the last argument configurable? Or would it lead to unexpected results?
Regards,
Niels -
2. Re: FTP Listener and number of connections that are opened
nl Oct 21, 2009 5:14 AM (in response to garuda)Ok, this seems to be worse than I've thought.
The RemoteGatewayListener is opening a connection on each action.
So if there are n files on the server, it'll need at least
1 (getFileList) + n*2 (getFile + rename/delete) connections.
Isn't it possible to reuse the connection until last file is processed? -
3. Re: FTP Listener and number of connections that are opened
tomeicher Oct 27, 2009 11:07 AM (in response to garuda)Well, of course that's doable, but the design of the interfaces and
classes doesn't look like anybody is eager to change all that...
In such cases, I just copy the class in question over to my source tree,
change the package (mind the license header) and implement my
changes.
Holding the connection as a member shouldn't be too hard, but I
guess you must disallow concurrent access somehow...
Cheers, Tom. -
4. Re: FTP Listener and number of connections that are opened
nl Oct 28, 2009 4:07 AM (in response to garuda)Hi Tom,
each schedule uses its own Listener (subsequent schedules may share). So what I did is keep the connection as a member at time of onSchedule() Method and close it afterwards, since with finishing this method, all files are being processed.
I also created a JIRA Issue for this (JBESB-2914) since this behaviour is not enterprise ready. Simple FTP is one thing, but think of secure connections...
Regards,
Niels