|
@@ -37,10 +37,12 @@ import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
|
+import com.fdkankan.rubbersheeting.ScalingService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.http.HttpHeaders;
|
|
import org.apache.http.HttpHeaders;
|
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
@@ -81,6 +83,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
@Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
|
|
@Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
|
|
private List<Integer> sdTilesSceneSourceList;
|
|
private List<Integer> sdTilesSceneSourceList;
|
|
|
|
|
|
|
|
+ @Value("#{'${elastic:userIds:}'.split(',')}")
|
|
|
|
+ private List<Long> elasticUserIds;
|
|
|
|
+
|
|
@Value("${env:gn}")
|
|
@Value("${env:gn}")
|
|
private String env;
|
|
private String env;
|
|
|
|
|
|
@@ -146,6 +151,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
private ILinkPanService linkPanService;
|
|
private ILinkPanService linkPanService;
|
|
@Autowired
|
|
@Autowired
|
|
private IJmgaService jmgaService;
|
|
private IJmgaService jmgaService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ScalingService scalingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -265,7 +274,22 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|
|
}
|
|
}
|
|
|
|
|
|
- mqProducer.sendByWorkQueue(queueModelingCall, message);
|
|
|
|
|
|
+ boolean elastic = false;
|
|
|
|
+ if(CollUtil.isNotEmpty(elasticUserIds)){
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
+ if(elasticUserIds.contains(scenePlus.getUserId())){
|
|
|
|
+ elastic = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(elastic){
|
|
|
|
+ mqProducer.sendByWorkQueue("modeling-call-C", message);
|
|
|
|
+ Thread.sleep(10000L);
|
|
|
|
+ //查询队列是否存在堆积(未消费数>0)
|
|
|
|
+
|
|
|
|
+ //开启弹性伸缩
|
|
|
|
+ }else{
|
|
|
|
+ mqProducer.sendByWorkQueue(queueModelingCall, message);
|
|
|
|
+ }
|
|
|
|
|
|
if(StrUtil.isNotEmpty(batchIds)){
|
|
if(StrUtil.isNotEmpty(batchIds)){
|
|
origFileUploadBatchService.update(new LambdaUpdateWrapper<OrigFileUploadBatch>().set(OrigFileUploadBatch::getStatus, 1).in(OrigFileUploadBatch::getBatchId, batchIds.split(",")));
|
|
origFileUploadBatchService.update(new LambdaUpdateWrapper<OrigFileUploadBatch>().set(OrigFileUploadBatch::getStatus, 1).in(OrigFileUploadBatch::getBatchId, batchIds.split(",")));
|
|
@@ -1170,14 +1194,23 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
// System.out.println(s + ":" + detFloorplanObj.getBoolean(s));
|
|
// System.out.println(s + ":" + detFloorplanObj.getBoolean(s));
|
|
//
|
|
//
|
|
// }
|
|
// }
|
|
- try {
|
|
|
|
- throw new BusinessException(345, "哈哈哈");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- if(e instanceof BusinessException){
|
|
|
|
- System.out.println(((BusinessException) e).getCode());
|
|
|
|
- System.out.println(((BusinessException) e).getMessage());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// try {
|
|
|
|
+// throw new BusinessException(345, "哈哈哈");
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// if(e instanceof BusinessException){
|
|
|
|
+// System.out.println(((BusinessException) e).getCode());
|
|
|
|
+// System.out.println(((BusinessException) e).getMessage());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("count", 5);
|
|
|
|
+ params.put("ackmode", "ack_requeue_true");
|
|
|
|
+ params.put("encoding", "auto");
|
|
|
|
+ String url = "http://119.23.182.50:15672/api/queues/vhost/name/get";
|
|
|
|
+ String s = HttpUtil.get(url, params);
|
|
|
|
+ System.out.println(s);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|