Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

409
Views
How can select dbIndex when I use RedisTemplate in Spring-Data-Redis?

I'm trying to use Spring-Data-Redis APIs,and want to select dbIndex of redis in RedisTemplate. But I cant find any relevant method in RedisTemplate.java, how can i do this?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you can set database index using jedisConnectionFactory bean. if you are using xml based config, you can set something like this

<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:host-name="server" p:port="6379">
    <property name="database" value="required index">
<bean/>

if you are using java based config, you can set like this inside config bean

  @Bean
  public RedisConnectionFactory connectionFactory() {
    // other configuration

    JedisConnectionFactory connection = new JedisConnectionFactory();
    connection.setDatabase("required db index");

    // other config
    return connection;
  }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!