Reputation: 145
How do I do that because the instruction at Bluemix seems only available for Java, JS, Ruby. I try to use ServiceStack, but there's no help. Any ideas will be appreciated! below is what I have done so far
using(var redis=new RedisClient(host, port,password ,db=0))
{
redis.Set("key1", "value1");
}
the last paramater "db" I have no idea what it is. My environment variable on Bluemix
{ "redis-2.6": [ { "name": "mychatdata", "label": "redis-2.6", "plan": "100", "credentials": { "hostname": "159.8.128.94", "host": "159.8.128.94", "port": 6300, "password": "*****", "name": "*****" } } ] }
Upvotes: 1
Views: 224
Reputation: 143369
Redis supports multiple databases which lets you maintain multiple separate datasets within the same redis process, if you don't need this you can ignore this parameter and use the default database index 0
.
Also note the recommended approach to access Redis Clients is to use one of the Thread Safe Redis Managers which you can store as a singleton and static instance:
IRedisClientsManager RedisManager = new RedisManagerPool("159.8.128.94");
Then you can resolve Redis clients from the Redis Manager:
var redis = RedisManager.GetClient();
Upvotes: 1