Embedding Apache FTP Server : Not able to login with 40 user Concurrently

199 Views Asked by At

I am using this Embedded server for integration testing of Spring-integration-ftp. I have to connect this ftp server to 40 spring integration ftp service I have also added ConcurrentLoginPermission to 50 still I am getting SENT: 421 Maximum login limit has been reached. Error Here is the code Which I have written for the embedded server.


   protected static final Integer FTP_PORT = 2221;
       protected static final String FTP_USER = "admin";
       protected static final String FTP_PASSWORD = "admin";
       protected static final String FTP_HOME_DIRECTORY = "src/test/resources/xml/checkpoint";```
   
   ```PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
           UserManager userManager = userManagerFactory.createUserManager();
           BaseUser user = new BaseUser();
           user.setName(FTP_USER);
           user.setPassword(FTP_PASSWORD);
           user.setHomeDirectory(FTP_HOME_DIRECTORY);
           List<Authority> authorities = new ArrayList<>();
           authorities.add(new WritePermission());
           authorities.add(new TransferRatePermission(50, 50));
           authorities.add(new ConcurrentLoginPermission(50, 50));
           user.setAuthorities(authorities);
           try {
               userManager.save(user);
           } catch (FtpException e) {
               e.printStackTrace();
           }
           ListenerFactory listenerFactory = new ListenerFactory();
           listenerFactory.setPort(FTP_PORT);
           FtpServerFactory factory = new FtpServerFactory();
           factory.setUserManager(userManager);
           factory.addListener("default", listenerFactory.createListener());
           FtpServer server = factory.createServer();
           try {
               server.start();
           } catch (FtpException e) {
               e.printStackTrace();
           }
           FakeFtpServer fakeFtpServer = new FakeFtpServer();
           fakeFtpServer.setServerControlPort(2222);
           FileSystem fileSystem = new UnixFakeFileSystem();
           fileSystem.add(new DirectoryEntry("/FTP_TEST"));
           fakeFtpServer.setFileSystem(fileSystem);
           UserAccount userAccount = new UserAccount("vioohcentral", "vioohcentral", "/FTP_TEST");
           fakeFtpServer.addUserAccount(userAccount);
           fakeFtpServer.start();

0

There are 0 best solutions below