forked from Thirdparty/wvp
add: log
parent
3b68a00018
commit
090b31f678
4
pom.xml
4
pom.xml
|
@ -41,6 +41,10 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.event.offline;
|
package com.genersoft.iot.vmp.gb28181.event.offline;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.connection.Message;
|
import org.springframework.data.redis.connection.Message;
|
||||||
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
|
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
|
||||||
|
@ -19,6 +21,7 @@ public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EventPublisher publisher;
|
private EventPublisher publisher;
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(KeepliveTimeoutListener.class);
|
||||||
|
|
||||||
public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
|
public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
|
||||||
super(listenerContainer);
|
super(listenerContainer);
|
||||||
|
@ -26,6 +29,7 @@ public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听失效的key,key格式为keeplive_deviceId
|
* 监听失效的key,key格式为keeplive_deviceId
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
* @param pattern
|
* @param pattern
|
||||||
*/
|
*/
|
||||||
|
@ -34,7 +38,9 @@ public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
|
||||||
// 获取失效的key
|
// 获取失效的key
|
||||||
String expiredKey = message.toString();
|
String expiredKey = message.toString();
|
||||||
if (!expiredKey.startsWith(VideoManagerConstants.KEEPLIVEKEY_PREFIX)) {
|
if (!expiredKey.startsWith(VideoManagerConstants.KEEPLIVEKEY_PREFIX)) {
|
||||||
System.out.println("收到redis过期监听,但开头不是"+VideoManagerConstants.KEEPLIVEKEY_PREFIX+",忽略");
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("收到redis过期监听,但开头不是" + VideoManagerConstants.KEEPLIVEKEY_PREFIX + ",忽略");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue