DemoInitListener
diff --git a/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.properties b/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.properties
index 1821a31..574a338 100644
--- a/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.properties
+++ b/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
-#Sun Jun 19 10:26:39 CST 2016
+#Sun Jul 10 14:49:35 CST 2016
version=1
groupId=wxtools.demo
m2e.projectName=demo
diff --git a/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.xml b/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.xml
index 22953af..da4a51a 100644
--- a/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.xml
+++ b/demo/target/m2e-wtp/web-resources/META-INF/maven/wxtools.demo/demo/pom.xml
@@ -40,5 +40,17 @@
demo
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.3.2
+
+
+ 1.8
+
+
+
diff --git a/java/src/main/java/com/soecode/wxtools/api/WxMessageInMemoryDuplicateChecker.java b/java/src/main/java/com/soecode/wxtools/api/WxMessageInMemoryDuplicateChecker.java
index ce2894e..1f15add 100644
--- a/java/src/main/java/com/soecode/wxtools/api/WxMessageInMemoryDuplicateChecker.java
+++ b/java/src/main/java/com/soecode/wxtools/api/WxMessageInMemoryDuplicateChecker.java
@@ -6,7 +6,7 @@
/**
*
- * 默认消息重复检查器
+ * 默认消息重试检查器
* 将每个消息id保存在内存里,每隔5秒清理已经过期的消息id,每个消息id的过期时间是15秒
*
* @author antgan
@@ -74,7 +74,7 @@ public void run() {
Long now = System.currentTimeMillis();
for (Map.Entry entry : msgId2Timestamp.entrySet()) {
if (now - entry.getValue() > timeToLive) {
- msgId2Timestamp.entrySet().remove(entry);
+ msgId2Timestamp.entrySet().remove(entry);
}
}
}
diff --git a/java/src/main/java/com/soecode/wxtools/api/WxMessageRouter.java b/java/src/main/java/com/soecode/wxtools/api/WxMessageRouter.java
index 0354314..4e7402f 100644
--- a/java/src/main/java/com/soecode/wxtools/api/WxMessageRouter.java
+++ b/java/src/main/java/com/soecode/wxtools/api/WxMessageRouter.java
@@ -115,6 +115,7 @@ public WxMessageRouterRule rule() {
*/
public WxXmlOutMessage route(final WxXmlMessage wxMessage) {
if (isDuplicateMessage(wxMessage)) {
+ System.out.println("重复消息");
// 如果是重复消息,那么就不做处理
return null;
}
@@ -157,15 +158,15 @@ public void run() {
}
/**
- * 验证是否重复消息
+ * 验证重试消息
* @param wxMessage
* @return
*/
protected boolean isDuplicateMessage(WxXmlMessage wxMessage) {
String messageId = "";
if (wxMessage.getMsgId() == null) {
- messageId = String.valueOf(wxMessage.getCreateTime()) + "-"
- + wxMessage.getFromUserName() + "-"
+ messageId = String.valueOf(wxMessage.getToUserName()) + "-"
+ + wxMessage.getFromUserName() + "-"+wxMessage.getContent()+"-"
+ String.valueOf(wxMessage.getEventKey() == null ? "" : wxMessage.getEventKey()) + "-"
+ String.valueOf(wxMessage.getEvent() == null ? "" : wxMessage.getEvent());
} else {
diff --git a/java/src/main/webapp/WEB-INF/web.xml b/java/src/main/webapp/WEB-INF/web.xml
index 4760589..6038ef7 100644
--- a/java/src/main/webapp/WEB-INF/web.xml
+++ b/java/src/main/webapp/WEB-INF/web.xml
@@ -1,4 +1,5 @@
wx-tools
+
\ No newline at end of file
diff --git a/java/target/classes/META-INF/maven/com.soecode.wx-tools/wx-tools/pom.properties b/java/target/classes/META-INF/maven/com.soecode.wx-tools/wx-tools/pom.properties
index 4e514b6..255477f 100644
--- a/java/target/classes/META-INF/maven/com.soecode.wx-tools/wx-tools/pom.properties
+++ b/java/target/classes/META-INF/maven/com.soecode.wx-tools/wx-tools/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
-#Sun Jun 19 10:26:42 CST 2016
+#Sun Jul 10 14:49:38 CST 2016
version=1.0-SNAPSHOT
groupId=com.soecode.wx-tools
m2e.projectName=wx-tools
diff --git a/lib/wx-tools-1.0.0.jar b/lib/wx-tools-1.0.1.jar
similarity index 86%
rename from lib/wx-tools-1.0.0.jar
rename to lib/wx-tools-1.0.1.jar
index a7c553b..8a661d7 100644
Binary files a/lib/wx-tools-1.0.0.jar and b/lib/wx-tools-1.0.1.jar differ