PooledRedisClientManager launches with Appharbor Redis URL
source link: https://www.codesd.com/item/pooledredisclientmanager-launches-with-appharbor-redis-url.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
PooledRedisClientManager launches with Appharbor Redis URL
I am trying out Redis on Appharbor in an MVC4 application. I am using the ServiceStack C# client for Redis. Everything was working when using the RedisClient
from ServiceStack.Redis
. However, because I only plan to use Redis for caching, I attempted to wire up the ICacheClient
that ServiceStack provides as a wrapper. Here is my StructureMap configuration (https://github.com/ServiceStack/ServiceStack/wiki/Caching):
x.For<IRedisClientsManager>().Use(() => new PooledRedisClientManager(redisUrl));
x.For<ICacheClient>().Use(c => c.GetInstance<IRedisClientsManager>().GetCacheClient());
My problem is that the PooledRedisClientManager
is throwing error, "input string was not in a correct format
" when I use the Redis-to-Go URL provided by Appharbor. Here is what that looks like:
redis://redistogo-appharbor:[email protected]:9081/
If I replace the Redis-to-Go URL with localhost:5051
everything works. What am I missing?
Prefixing a redis://
is not any known redis convention - it must be a RedisToGo or AppHarbor convention.
ServiceStack's C# RedisClient supports standard "password@host:port" convention, e.g:
container.Register(c => new PooledRedisClientManager(
"redistogo-appharbor:[email protected]:9081"
));
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK