after 1.redis pub/sub has been running for a period of time, subscription listening cannot be queried by using the pubsub channels command in client
2. After the project starts, it can publish and subscribe normally, and the program of subscription monitoring can be executed normally, but after about 1: 00 in the morning, the subscription part does not respond to, pubsub channels and cannot be queried, and the location of the publication is normal. There is no exception in the log of
3.redis
4. Refer to the https://blog.csdn.net/luyaoyi. for setting. The current configuration is"normal 000 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
5. The following is redis.xml "s snooping configuration for pub/sub
<bean id="redisMessageListener503" class="org.springframework.data.redis.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="com.sfa.ghs.webservice.listener.RedisMessageListener503"/>
</constructor-arg>
</bean>
<bean id="redisMessageListener68" class="org.springframework.data.redis.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="com.sfa.ghs.webservice.listener.RedisMessageListener68"/>
</constructor-arg>
</bean>
<bean id="redisContainer" class="org.springframework.data.redis.listener.RedisMessageListenerContainer">
<property name="connectionFactory" ref="jeidsConnectionFactory" />
<property name="messageListeners">
<map>
<entry key-ref="redisMessageListener503">
<list>
<!-- -->
<bean class="org.springframework.data.redis.listener.ChannelTopic">
<constructor-arg value="channel_503" />
</bean>
</list>
</entry>
<entry key-ref="redisMessageListener68">
<list>
<!-- -->
<bean class="org.springframework.data.redis.listener.ChannelTopic">
<constructor-arg value="channel_68" />
</bean>
</list>
</entry>
</map>
</property>
</bean>
6. The following is part of the code for the subscription implementation class
/**
* 503 -
*
* @author 89003039
* @date 2018516 6:45:33
*/
public class RedisMessageListener503 implements MessageListener, IRedisMessageListener {
private static Logger logger = Logger.getLogger(RedisMessageListener503.class);
@Autowired
private IJoindataBroadWeightInfoBiz joindataBroadWeightInfoBiz;
@Autowired
private IJoinDataWsBiz joinDataWsBiz;
@Autowired
private JedisClient jedisClusterSingle;
/**
* 503
* 1.503
* 2.+redis6768
* 3.50367
* 4.503redis
* @author 89003039
* @return
* @date 2018528 8:15:51
*/
@Override
public synchronized void onMessage(Message message, byte[] bytes) {
logger.info("**** begin 503 data clear. ****");
String msgContent = (String) jedisClusterSingle.getValueSerializer(message.getBody());
String topic = (String) jedisClusterSingle.getStringSerializer(message.getChannel());
logger.info("**** topic:" + topic + " ****");
long begin = System.currentTimeMillis();