我创建了一个用户提供的Redis服务,如下所示
cf cups p-redis -p "{\"host\":\"xx.xx.xxx.xxx\",\"password\":\"xxxxxxxx\",\"port\":6379}"
Redis自动重新配置或服务连接器并不会自动获取此错误,并且会收到jedis连接池异常。
当我绑定(bind)到从市场创建的Redis服务时,它可以在Spring Boot应用程序中正常工作。这确认代码或配置没有问题。我想要Redis的自定义服务以与Spring Boot应用程序一起使用。如何创建此类服务?我在这里想念什么?这可能吗?
System-Provided:
{
"VCAP_SERVICES": {
"user-provided": [
{
"credentials": {
"host": "xx.xx.xxx.xxx",
"password": "xxxxxxxx",
"port": 6379
},
"label": "user-provided",
"name": "p-redis",
"syslog_drain_url": "",
"tags": []
}
]
}
}
我可以扩展抽象云连接器并自己创建redis工厂,但是我想通过自定义服务和自动配置使它开箱即用。
最佳答案
映射此服务的所有路由都会自动到达 spring-cloud-connectors
project。如果看一下实现,服务必须是tagged with redis
的expose a uri with a redis
scheme或credential keys based on a permutation of uri
。
如果您想要其他检测行为,建议在GitHub存储库中使用opening an issue。