package com.example.sshd.config; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.client5.http.impl.async.HttpAsyncClients; import org.apache.hc.core5.reactor.IOReactorConfig; import org.apache.sshd.common.Session; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; @Configuration public class AppConfig { @Bean @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) public Map remoteSessionMapping() { return new ConcurrentHashMap<>(); } @Bean @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) public Map ipInfoMapping() { return new ConcurrentHashMap<>(); } @Bean public CloseableHttpAsyncClient asyncClient() { final IOReactorConfig ioReactorConfig = IOReactorConfig.custom().build(); final CloseableHttpAsyncClient client = HttpAsyncClients.custom().setIOReactorConfig(ioReactorConfig).build(); client.start(); return client; } }