Redis中的notify-keyspace-events是什么

时间:2015-06-29 11:08:22

标签: java spring redis spring-boot

我开始设置spring项目我跟着这个spring-boot article我收到以下错误

  Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: ERR Unsupported CONFIG parameter: notify-keyspace-events; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR Unsupported CONFIG parameter: notify-keyspace-events
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at demo.UiApplication.main(UiApplication.java:29)

引起:org.springframework.dao.InvalidDataAccessApiUsageException:ERR不支持的CONFIG参数:notify-keyspace-events;嵌套异常是redis.clients.jedis.exceptions.JedisDataException:ERR不支持的CONFIG参数:notify-keyspace-events     在org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:44)     在org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:36)     在org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37)     在org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37)     在org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:195)     在org.springframework.data.redis.connection.jedis.JedisConnection.setConfig(JedisConnection.java:618)     在org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration $ EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:170)     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)     ......还有15个 引起:redis.clients.jedis.exceptions.JedisDataException:ERR不支持的CONFIG参数:notify-keyspace-events     at redis.clients.jedis.Protocol.processError(Protocol.java:113)     at redis.clients.jedis.Protocol.process(Protocol.java:131)     at redis.clients.jedis.Protocol.read(Protocol.java:200)     at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:285)     at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:184)     at redis.clients.jedis.Jedis.configSet(Jedis.java:2797)     在org.springframework.data.redis.connection.jedis.JedisConnection.setConfig(JedisConnection.java:616)     ......还有18个

请告诉我如何解决此问题

1 个答案:

答案 0 :(得分:0)

您可以在以下位置阅读有关Redis键空间通知的信息:http://redis.io/topics/notifications

无论实际情况如何,您的Redis服务器似乎都不支持它们(例如< v2.8)。