Comments (3)
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem.
You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
from spring-data-redis.
This is my redis configuration class
@Configuration
class MyConfig {
@Bean
LettuceConnectionFactory connectionFactory() {
return new LettuceConnectionFactory();
}
@Bean
ReactiveRedisTemplate<String, String> ReactiveRedisTemplate(ReactoveRedisConnectionFactory connectionFactory) {
return new ReactiveRedisTemplate<>(connectionFactory, RedisSerializationContext.string());
}
}
This is my project maven environment
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
</dependency>
</dependencies>
And I configured the host,password&port in application.properties
spring.data.redis.host=xxx.com
spring.data.redis.port=14777
spring.data.redis.password=xxxxx
Then I wrote a test case intending to pass a list data to my Redis remote server
@Qualifier("ReactiveRedisTemplate")
@Autowired
private ReactiveRedisOperations<String, String> operations;
public Mono<Long> addLink(String userId, String url) {
return operations.opsForList().leftPush(userId, url);
}
@Test
void testA() {
Mono<Long> mono = addLink("tks1", "http://google.com");
log.info("mono: {}", mono.block());
}
And then an error.The error message is as follows:
- org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis
- Unable to connect to localhost/:6379
- Connection refused: no further information: localhost/127.0.0.1:6379
But I can connect to the Redis server by way of RedisStandaloneConfiguration:
@Configuration
class MyConfig {
@Bean
LettuceConnectionFactory connectionFactory() {
RedisStandaloneConfiguration serverConfig = new RedisStandaloneConfiguration("xxx.com", 14777);
serverConfig.setPassword("xxxxx");
return new LettuceConnectionFactory(serverConfig, clientConfig);
}
@Bean
ReactiveRedisTemplate<String, String> ReactiveRedisTemplate(ReactoveRedisConnectionFactory connectionFactory) {
return new ReactiveRedisTemplate<>(connectionFactory, RedisSerializationContext.string());
}
}
Then the data was uploaded successfully
INFO 3296 --- [ main] p.l.LearnSpringBootApplicationTest : mono: 1
So, spring-boot-starter-data-redis with version 3.2.5 unable to configure Redis startup configurations by modifying configuration files such as application.properties?
@mp911de
from spring-data-redis.
Hello, I'm having the same issue. I did what @UnfetteredCodeMan mentions to solved my problem, using the application.properties doesn't work at all. In my case, I use spring boot 3.3.0 and redisStandalone.
from spring-data-redis.
Related Issues (20)
- StreamListener can't stop HOT 1
- Links in the documentation are broken HOT 1
- do it acquire hikaricp connection when using repository interface? HOT 1
- Default shutdownQuietPeriod should be 0 or some fraction of the shutdownTimeout HOT 2
- (Suggestion) Support SET WITH EXAT/PXAT ON Expiration HOT 1
- Bundle Javadoc with Antora documentation site
- Align EnableRedisRepositories with changes in data-commons.
- `StringRedisConnection` returns `null` using read operations during transactions HOT 1
- If ShadowCopy is OFF do not use the phantom key HOT 1
- auto clear pending list after reading msg when process stop HOT 2
- `LettuceConnectionFactory` lifecycle stops connections before depending components are stopped HOT 3
- CacheManager Not working with RedisCredentialsProviderFactory HOT 1
- Upgrade to Maven Wrapper 3.9.8
- Upgrade to Maven Wrapper 3.9.8
- Upgrade to Maven Wrapper 3.9.8
- Upgrade to Lettuce 6.4
- Upgrade to Jedis 5.1.4
- Refactor Tests to `instanceof` pattern variable HOT 2
- Release 3.2.10 (2023.1.10)
- Release 3.3.4 (2024.0.4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-redis.