...
|
...
|
@@ -6,17 +6,13 @@ import com.caac.imf.api.IMFClient; |
|
|
|
|
|
import redis.clients.jedis.Jedis;
|
|
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
public class AgentSender extends Thread{
|
|
|
|
|
|
private static final Logger logger = Logger.getLogger(AgentSender.class);
|
|
|
private static final String stype = "/MSG/META/STYP";
|
|
|
|
|
|
public volatile boolean bool = false;
|
|
|
Jedis jedis = new Jedis("10.50.3.73", 6379);
|
|
|
// Jedis jedis = new Jedis("192.168.0.253", 6379);
|
|
|
public String str ;
|
|
|
|
|
|
private IMFClient client;
|
|
|
|
...
|
...
|
@@ -24,8 +20,6 @@ public class AgentSender extends Thread{ |
|
|
this.client = client;
|
|
|
}
|
|
|
|
|
|
public AgentSender(){
|
|
|
}
|
|
|
|
|
|
public void run(){
|
|
|
logger.info(jedis);
|
...
|
...
|
@@ -34,15 +28,15 @@ public class AgentSender extends Thread{ |
|
|
if(Main.isSuc){
|
|
|
if(Main.LOGIN_OK){
|
|
|
String SendMsg = jedis.rpoplpush("task-queue", "tmp-queue"); //取队列消息
|
|
|
logger.info("队列消息为:》》》"+SendMsg);
|
|
|
|
|
|
//9是发送成功
|
|
|
if(SendMsg !=null){
|
|
|
|
|
|
//队列消息不为NULL开始发送
|
|
|
if(SendMsg !=null && SendMsg.length() != 0){
|
|
|
logger.info("《《《已读取队列消息,请关注下方发送信息LOG回显》》》");
|
|
|
try{
|
|
|
String returnMsg = client.sendMSG(SendMsg);
|
|
|
logger.debug("<<发送返回的信息:"+returnMsg+">>");
|
|
|
|
|
|
//9是发送成功
|
|
|
if(returnMsg.indexOf("<CODE>9</CODE>")>=0){
|
|
|
jedis.rpop("tmp-queue");
|
|
|
logger.debug("<<移除队列>>");
|
...
|
...
|
@@ -56,6 +50,8 @@ public class AgentSender extends Thread{ |
|
|
logger.info("!!<<请注意!发送异常====>>!!");
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
logger.info("*********当前队列为空*********");
|
|
|
}
|
|
|
|
|
|
}else{
|
...
|
...
|
@@ -71,11 +67,4 @@ public class AgentSender extends Thread{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
public String getStr() {
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
public void setStr(String str) {
|
|
|
this.str = str;
|
|
|
}
|
|
|
} |
...
|
...
|
|