stackexchange.redis - Has the StackExchange Redis connection config changed? -
i have been using following connect redis without issue until today, have explicitly state provide database parameter because of this:
argumentoutofrangeexception specified argument out of range of valid values. parameter name: db @ stackexchange.redis.connectionmultiplexer.getdatabase(int32 db, object asyncstate) @ myserver.myclass..cctor() this config have been using:
private static lazy<connectionmultiplexer> myconnection = new lazy<connectionmultiplexer>(() => { return connectionmultiplexer.connect(myredisconnstring); }); public static connectionmultiplexer connger { { return myconnection.value; } } and @ class level:
private static readonly idatabase redisdb = redisconfig.connger.getdatabase(); providing db parameter thus: redisconfig.connger.getdatabase(0); fixed error of course; more of concern whether there have been seeming breaking changes class libraries littered redis!
update after thinking had resolved issue, no apparent reason connectionmultiplexer started failing again above config. tried defaultdatabase=0 in string , tried configuration.option , got error:
exception type: argumentexception exception message: keyword 'defaultdatabase' not supported @ stackexchange.redis.configurationoptions.optionkeys.unknown(string key) @ stackexchange.redis.configurationoptions.doparse(string configuration, boolean ignoreunknown) @ stackexchange.redis.connectionmultiplexer.createmultiplexer(object configuration) @ stackexchange.redis.connectionmultiplexer.connectimpl(func 1 multiplexerfactory, textwriter log) @ system.lazy1.createvalue()`
and configoption mode:
exception type: typeinitializationexception method not found: 'void stackexchange.redis.configurationoptions.set_defaultdatabase(system.nullable 1<int32>)'.
i removed system.lazy part of config too, same errors.
putting 0 value in getdatabase() parameter stopped error now; concern remains doesn't match documented implementation.
you specifying wrong default database in config?
try adding defaultdatabase=0 connection string.
Comments
Post a Comment