Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

Why does Redis show 2 clients connected when i run my spring boot project?

$
0
0

I have a Spring boot project with angular 2 front end ,when i run spring boot project and turn on the Redis server,the Redis server shows 2 clients are connected to it.Why is that? It should be 1 client because only spring project is connecting to it.I am using Spring boot 2.3 and Redis version is 2.4

spring-

  @Configuration  @EnableRedisHttpSession  class RedisSessionConfig {       @Bean        public LettuceConnectionFactory connectionFactory() {            return new LettuceConnectionFactory();         }  }@Configuration@EnableWebSecuritypublic class SecurityConfig extends WebSecurityConfigurerAdapter{    @Autowired    Environment env;     @Autowired    UserSecurityService useSecurityService;    private BCryptPasswordEncoder passwordEncoder() {        return SecurityUtility.passwordEncoder();    }    private static final String[] PUBLIC_MATHCES= {"/css/**","/js/**","/image/**","/book/**","/user/**"    };    @Override    protected void configure(AuthenticationManagerBuilder auth) throws Exception {        auth.userDetailsService(useSecurityService).passwordEncoder(passwordEncoder());    }    @Override    protected void configure(HttpSecurity http) throws Exception {        http.authorizeRequests()            .antMatchers(PUBLIC_MATHCES).permitAll()            .anyRequest().authenticated()            .and();        http.csrf().disable()            .cors()            .and()            .httpBasic();    }      @Bean      public HttpSessionIdResolver httpSessionStrategy() {          return  HeaderHttpSessionIdResolver.xAuthToken();      }}@Configurationpublic class RedisConfigureAction {    @Bean    public ConfigureRedisAction configureRedisAction() {        return ConfigureRedisAction.NO_OP;    }}

enter image description here

enter image description here


Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>