|
|
@ -1,6 +1,7 @@
|
|
|
|
package weaver.interfaces.dito.mq;
|
|
|
|
package weaver.interfaces.dito.mq;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
|
|
|
|
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
|
|
|
|
import org.apache.rocketmq.client.exception.MQClientException;
|
|
|
|
import org.apache.rocketmq.client.exception.MQClientException;
|
|
|
|
import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
|
|
|
|
import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
|
|
|
@ -16,6 +17,7 @@ import javax.servlet.http.HttpServlet;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -47,12 +49,32 @@ public class HrmRocketmqServlet extends HttpServlet {
|
|
|
|
bb.writeLog("isSampleMode3:"+isSampleMode);
|
|
|
|
bb.writeLog("isSampleMode3:"+isSampleMode);
|
|
|
|
|
|
|
|
|
|
|
|
if(isSampleMode){
|
|
|
|
if(isSampleMode){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String hrmMqRunIP = PropBean.getUfPropValue("hrmMqRunIP");
|
|
|
|
|
|
|
|
bb.writeLog("hrmMqRunIP:"+hrmMqRunIP);
|
|
|
|
|
|
|
|
InetAddress localHost = InetAddress.getLocalHost();
|
|
|
|
|
|
|
|
String hostAddress = localHost.getHostAddress();
|
|
|
|
|
|
|
|
bb.writeLog("hrmMqRunIP:"+hrmMqRunIP);
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(hostAddress) && StringUtils.isNotBlank(hostAddress) && hostAddress.equals(hrmMqRunIP)){
|
|
|
|
|
|
|
|
bb.writeLog("initData");
|
|
|
|
initData();
|
|
|
|
initData();
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
if (isMainIp) {
|
|
|
|
|
|
|
|
//则调用service方法加载设置,重新获取workflowid相关超时设置OvertimeEntity
|
|
|
|
String hrmMqRunIP = PropBean.getUfPropValue("hrmMqRunIP");
|
|
|
|
|
|
|
|
bb.writeLog("hrmMqRunIP:"+hrmMqRunIP);
|
|
|
|
|
|
|
|
InetAddress localHost = InetAddress.getLocalHost();
|
|
|
|
|
|
|
|
String hostAddress = localHost.getHostAddress();
|
|
|
|
|
|
|
|
bb.writeLog("hostAddress:"+hostAddress);
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(hostAddress) && StringUtils.isNotBlank(hostAddress) && hostAddress.equals(hrmMqRunIP)){
|
|
|
|
|
|
|
|
bb.writeLog("initData");
|
|
|
|
initData();
|
|
|
|
initData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (isMainIp) {
|
|
|
|
|
|
|
|
// //则调用service方法加载设置,重新获取workflowid相关超时设置OvertimeEntity
|
|
|
|
|
|
|
|
// initData();
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|