Commit bc0bc8863235f8646a46e983a5dfc649818e494a
1 parent
20974f33
iss提交5:
1、添加使用car服务的controller,把原来的controller放入legacy包中 2、在dubbo消费者配置文件中配置car服务
Showing
5 changed files
with
302 additions
and
62 deletions
src/main/java/com/bsth/controller/schedule/basicinfo/CarController_facade.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.basicinfo; | ||
| 2 | + | ||
| 3 | +import com.alibaba.dubbo.config.annotation.Reference; | ||
| 4 | +import com.bsth.common.ResponseCode; | ||
| 5 | +import com.bsth.control_v2.plan_module.common.dto.baseinfo.CarDto; | ||
| 6 | +import com.bsth.control_v2.plan_module.common.dto.sys.UserDto; | ||
| 7 | +import com.bsth.control_v2.plan_module.common.service.BServiceFacade; | ||
| 8 | +import com.bsth.control_v2.plan_module.common.service.baseinfo.CarServiceFacade; | ||
| 9 | +import com.bsth.controller.schedule.BController_facade; | ||
| 10 | +import com.bsth.service.schedule.CarsService; | ||
| 11 | +import com.bsth.service.schedule.utils.DataToolsFile; | ||
| 12 | +import org.apache.commons.lang3.StringUtils; | ||
| 13 | +import org.apache.poi.ss.usermodel.Workbook; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 16 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 17 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 18 | +import org.springframework.web.bind.annotation.RestController; | ||
| 19 | +import org.springframework.web.multipart.MultipartFile; | ||
| 20 | + | ||
| 21 | +import javax.servlet.http.HttpServletResponse; | ||
| 22 | +import java.io.*; | ||
| 23 | +import java.util.*; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * 车辆基础信息controller_facade | ||
| 27 | + */ | ||
| 28 | +@RestController(value = "carsController_sc") | ||
| 29 | +@RequestMapping("cars_sc") | ||
| 30 | +public class CarController_facade extends BController_facade<Integer, CarDto> { | ||
| 31 | + | ||
| 32 | + @Override | ||
| 33 | + public void setCreateUserInfo(CarDto carDto, Integer userId, Date createDate) { | ||
| 34 | + UserDto userDto = UserDto.getBuilder() | ||
| 35 | + .setId(userId) | ||
| 36 | + .build(); | ||
| 37 | + carDto.setCreateBy(userDto); | ||
| 38 | + carDto.setCreateDate(createDate); | ||
| 39 | + } | ||
| 40 | + @Override | ||
| 41 | + public void setUpdateUserInfo(CarDto carDto, Integer userId, Date updateDate) { | ||
| 42 | + UserDto userDto = UserDto.getBuilder() | ||
| 43 | + .setId(userId) | ||
| 44 | + .build(); | ||
| 45 | + carDto.setUpdateBy(userDto); | ||
| 46 | + carDto.setUpdateDate(updateDate); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + @Reference | ||
| 50 | + private CarServiceFacade carServiceFacade; | ||
| 51 | + @Override | ||
| 52 | + protected BServiceFacade<Integer, CarDto> getBServiceFacade() { | ||
| 53 | + return carServiceFacade; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET) | ||
| 57 | + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) { | ||
| 58 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 59 | + try { | ||
| 60 | + // 自编号验证 | ||
| 61 | + CarDto carDto = CarDto.getBuilder() | ||
| 62 | + .setId(param.get("id_eq") == null ? | ||
| 63 | + null : Integer.valueOf(param.get("id_eq").toString())) | ||
| 64 | + .setInsideCode(param.get("insideCode_eq") == null ? | ||
| 65 | + null : param.get("insideCode_eq").toString()) | ||
| 66 | + .build(); | ||
| 67 | + this.carServiceFacade.validate_repeat_nbbh(carDto); | ||
| 68 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 69 | + } catch (Exception exp) { | ||
| 70 | + rtn.put("status", ResponseCode.ERROR); | ||
| 71 | + rtn.put("msg", exp.getMessage()); | ||
| 72 | + } | ||
| 73 | + return rtn; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET) | ||
| 77 | + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) { | ||
| 78 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 79 | + try { | ||
| 80 | + // 车辆编号验证 | ||
| 81 | + CarDto carDto = CarDto.getBuilder() | ||
| 82 | + .setId(param.get("id_eq") == null ? | ||
| 83 | + null : Integer.valueOf(param.get("id_eq").toString())) | ||
| 84 | + .setCarCode(param.get("carCode_eq") == null ? | ||
| 85 | + null : param.get("carCode_eq").toString()) | ||
| 86 | + .build(); | ||
| 87 | + this.carServiceFacade.validate_repeat_clbh(carDto); | ||
| 88 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 89 | + } catch (Exception exp) { | ||
| 90 | + rtn.put("status", ResponseCode.ERROR); | ||
| 91 | + rtn.put("msg", exp.getMessage()); | ||
| 92 | + } | ||
| 93 | + return rtn; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET) | ||
| 97 | + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) { | ||
| 98 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 99 | + try { | ||
| 100 | + // 车牌号验证 | ||
| 101 | + CarDto carDto = CarDto.getBuilder() | ||
| 102 | + .setId(param.get("id_eq") == null ? | ||
| 103 | + null : Integer.valueOf(param.get("id_eq").toString())) | ||
| 104 | + .setCarPlate(param.get("carPlate_eq") == null ? | ||
| 105 | + null : param.get("carPlate_eq").toString()) | ||
| 106 | + .build(); | ||
| 107 | + this.carServiceFacade.validate_repeat_cph(carDto); | ||
| 108 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 109 | + } catch (Exception exp) { | ||
| 110 | + rtn.put("status", ResponseCode.ERROR); | ||
| 111 | + rtn.put("msg", exp.getMessage()); | ||
| 112 | + } | ||
| 113 | + return rtn; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET) | ||
| 117 | + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) { | ||
| 118 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 119 | + try { | ||
| 120 | + // 设备编号验证 | ||
| 121 | + CarDto carDto = CarDto.getBuilder() | ||
| 122 | + .setId(param.get("id_eq") == null ? | ||
| 123 | + null : Integer.valueOf(param.get("id_eq").toString())) | ||
| 124 | + .setEquipmentCode(param.get("equipmentCode_eq") == null ? | ||
| 125 | + null : param.get("equipmentCode_eq").toString()) | ||
| 126 | + .build(); | ||
| 127 | + this.carServiceFacade.validate_repeat_sbbh(carDto); | ||
| 128 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 129 | + } catch (Exception exp) { | ||
| 130 | + rtn.put("status", ResponseCode.ERROR); | ||
| 131 | + rtn.put("msg", exp.getMessage()); | ||
| 132 | + } | ||
| 133 | + return rtn; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + //------------------ TODO:导入导出逻辑,之后会服务化 -----------------// | ||
| 137 | + @Autowired | ||
| 138 | + private CarsService carsService; | ||
| 139 | + // 上传excel文件 | ||
| 140 | + @RequestMapping(value = "/uploadFile", method = RequestMethod.POST) | ||
| 141 | + public Map<String, Object> uploadFile(MultipartFile file) { | ||
| 142 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 143 | + try { | ||
| 144 | + DataToolsFile dataToolsFile = carsService.uploadFile(file.getOriginalFilename(), file.getBytes()); | ||
| 145 | + // excel文件名 | ||
| 146 | + String fileName = dataToolsFile.getFile().getAbsolutePath(); | ||
| 147 | + Workbook wb = dataToolsFile.getFileType().getWorkBook(dataToolsFile.getFile()); | ||
| 148 | + | ||
| 149 | + // excel文件sheet | ||
| 150 | + List<String> sheetnames = new ArrayList<>(); | ||
| 151 | + for (int i = 0; i < wb.getNumberOfSheets(); i ++) { | ||
| 152 | + sheetnames.add(wb.getSheetAt(i).getSheetName()); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + wb.close(); | ||
| 156 | + | ||
| 157 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 158 | + rtn.put("filename", fileName); | ||
| 159 | + rtn.put("sheetnames", StringUtils.join(sheetnames, ",")); | ||
| 160 | + } catch (Exception exp) { | ||
| 161 | + exp.printStackTrace(); | ||
| 162 | + rtn.put("status", ResponseCode.ERROR); | ||
| 163 | + rtn.put("msg", exp.getMessage()); | ||
| 164 | + } | ||
| 165 | + return rtn; | ||
| 166 | + } | ||
| 167 | + // 导入excel文件 | ||
| 168 | + @RequestMapping(value = "/importFile", method = RequestMethod.POST) | ||
| 169 | + public Map<String, Object> importFile(@RequestParam Map<String, Object> params) { | ||
| 170 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 171 | + | ||
| 172 | + try { | ||
| 173 | + File file = new File(String.valueOf(params.get("filename"))); | ||
| 174 | + if (!file.exists()) { | ||
| 175 | + throw new Exception("导入文件不存在!"); | ||
| 176 | + } | ||
| 177 | + carsService.importData(file, params); | ||
| 178 | + | ||
| 179 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 180 | + rtn.put("msg", "导入文件成功"); | ||
| 181 | + } catch (Exception exp) { | ||
| 182 | + rtn.put("status", ResponseCode.ERROR); | ||
| 183 | + rtn.put("msg", exp.getMessage()); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + return rtn; | ||
| 187 | + } | ||
| 188 | + // 上传并导入excel文件 | ||
| 189 | + @RequestMapping(value = "/uploadAndImportFile", method = RequestMethod.POST) | ||
| 190 | + public Map<String, Object> uploadAndImportFile(MultipartFile file) { | ||
| 191 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 192 | + | ||
| 193 | + try { | ||
| 194 | + DataToolsFile dataToolsFile = carsService.uploadFile(file.getOriginalFilename(), file.getBytes()); | ||
| 195 | + Map<String, Object> params = new HashMap<>(); | ||
| 196 | + carsService.importData(dataToolsFile.getFile(), params); | ||
| 197 | + | ||
| 198 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 199 | + rtn.put("msg", "上传&导入文件成功"); | ||
| 200 | + } catch (Exception exp) { | ||
| 201 | + exp.printStackTrace(); | ||
| 202 | + rtn.put("status", ResponseCode.ERROR); | ||
| 203 | + rtn.put("msg", exp.getMessage()); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + return rtn; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + // 导出数据到xls文件 | ||
| 210 | + @RequestMapping(value = "/exportFile", method = RequestMethod.GET) | ||
| 211 | + public void exportFile(HttpServletResponse response, | ||
| 212 | + @RequestParam Map<String, Object> params) throws Exception { | ||
| 213 | + DataToolsFile dataToolsFile = carsService.exportData(params); | ||
| 214 | + // 流输出导出文件 | ||
| 215 | + response.setHeader("content-type", "application/octet-stream"); | ||
| 216 | + response.setHeader("Content-Disposition", "attachment; filename=" + dataToolsFile.getFile().getName()); | ||
| 217 | + response.setContentType("application/octet-stream"); | ||
| 218 | + | ||
| 219 | + OutputStream os = response.getOutputStream(); | ||
| 220 | + BufferedOutputStream bos = new BufferedOutputStream(os); | ||
| 221 | + | ||
| 222 | + InputStream is = new FileInputStream(dataToolsFile.getFile()); | ||
| 223 | + BufferedInputStream bis = new BufferedInputStream(is); | ||
| 224 | + | ||
| 225 | + int length = 0; | ||
| 226 | + byte[] temp = new byte[1 * 1024 * 10]; | ||
| 227 | + while ((length = bis.read(temp)) != -1) { | ||
| 228 | + bos.write(temp, 0, length); | ||
| 229 | + } | ||
| 230 | + bos.flush(); | ||
| 231 | + bis.close(); | ||
| 232 | + bos.close(); | ||
| 233 | + is.close(); | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + | ||
| 237 | + | ||
| 238 | + | ||
| 239 | +} |
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.java renamed to src/main/java/com/bsth/controller/schedule/basicinfo/legacy/CarsController.java
| 1 | -package com.bsth.controller.schedule.basicinfo; | 1 | +package com.bsth.controller.schedule.basicinfo.legacy; |
| 2 | 2 | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | import com.bsth.controller.schedule.BController; | 4 | import com.bsth.controller.schedule.BController; |
| @@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | import org.springframework.web.bind.annotation.RequestMapping; | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | import org.springframework.web.bind.annotation.RequestMethod; | 10 | import org.springframework.web.bind.annotation.RequestMethod; |
| 11 | import org.springframework.web.bind.annotation.RequestParam; | 11 | import org.springframework.web.bind.annotation.RequestParam; |
| 12 | -import org.springframework.web.bind.annotation.RestController; | ||
| 13 | 12 | ||
| 14 | import java.util.HashMap; | 13 | import java.util.HashMap; |
| 15 | import java.util.Map; | 14 | import java.util.Map; |
| @@ -17,8 +16,8 @@ import java.util.Map; | @@ -17,8 +16,8 @@ import java.util.Map; | ||
| 17 | /** | 16 | /** |
| 18 | * 车辆基础信息controller | 17 | * 车辆基础信息controller |
| 19 | */ | 18 | */ |
| 20 | -@RestController(value = "carsController_sc") | ||
| 21 | -@RequestMapping("cars_sc") | 19 | +//@RestController(value = "carsController_sc") |
| 20 | +//@RequestMapping("cars_sc") | ||
| 22 | public class CarsController extends BController<Cars, Integer> { | 21 | public class CarsController extends BController<Cars, Integer> { |
| 23 | @Autowired | 22 | @Autowired |
| 24 | private CarsService carsService; | 23 | private CarsService carsService; |
src/main/resources/dubbo/applicationContext_dubbo_consumer.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" | ||
| 3 | - xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
| 4 | - http://www.springframework.org/schema/beans/spring-beans.xsd | ||
| 5 | - http://code.alibabatech.com/schema/dubbo | ||
| 6 | - http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> | ||
| 7 | - | ||
| 8 | - <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --> | ||
| 9 | - <dubbo:application name="bsth_control_v2" /> | ||
| 10 | - | ||
| 11 | - <!-- 使用zookeeper注册中心暴露服务地址 --> | ||
| 12 | - <!-- 注册中心地址 --> | ||
| 13 | - <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181" check="false" /> | ||
| 14 | - | ||
| 15 | - <!-- 时刻表班型明细服务 --> | ||
| 16 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.timetable.TTInfoBxDetailServiceFacade" id="tTInfoBxDetailServiceFacadeImpl" check="false" /> | ||
| 17 | - <!-- 时刻表明细服务 --> | ||
| 18 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.timetable.TTInfoDetailServiceFacade" id="tTInfoDetailServiceFacadeImpl" check="false" /> | ||
| 19 | - <!-- 日志服务 --> | ||
| 20 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.log.LogServiceFacade" id="logServiceFacadeImpl" check="false" /> | ||
| 21 | - | ||
| 22 | - <!-- TODO:还有其他排班计划服务 --> | ||
| 23 | - <!-- 排班计划查询服务 --> | ||
| 24 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanServiceFacade" id="planServiceFacadeImpl" check="false" /> | ||
| 25 | - <!-- 排班明细查询服务 --> | ||
| 26 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanInfoServiceFacade" id="planInfoServiceFacadeImpl" check="false" /> | ||
| 27 | - <!-- 排班前置验证服务 --> | ||
| 28 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade" id="planPreValidateFacadeImpl" check="false" /> | ||
| 29 | - <!-- 排班生成服务 --> | ||
| 30 | - <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanGenerateFacade" ref="planGenerateFacadeImpl" check="false" /> | ||
| 31 | - | ||
| 32 | -</beans> | ||
| 33 | \ No newline at end of file | 1 | \ No newline at end of file |
| 2 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 3 | +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" | ||
| 4 | + xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
| 5 | + http://www.springframework.org/schema/beans/spring-beans.xsd | ||
| 6 | + http://code.alibabatech.com/schema/dubbo | ||
| 7 | + http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> | ||
| 8 | + | ||
| 9 | + <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --> | ||
| 10 | + <dubbo:application name="bsth_control_v_multi_service" /> | ||
| 11 | + | ||
| 12 | + <!-- 使用zookeeper注册中心暴露服务地址 --> | ||
| 13 | + <!-- 注册中心地址 --> | ||
| 14 | + <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181" check="false" /> | ||
| 15 | + | ||
| 16 | + <!-- 车辆信息服务 --> | ||
| 17 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.baseinfo.CarServiceFacade" id="carServiceFacadeImpl" check="false" /> | ||
| 18 | + | ||
| 19 | + <!-- 时刻表班型明细服务 --> | ||
| 20 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.timetable.TTInfoBxDetailServiceFacade" id="tTInfoBxDetailServiceFacadeImpl" check="false" /> | ||
| 21 | + <!-- 时刻表明细服务 --> | ||
| 22 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.timetable.TTInfoDetailServiceFacade" id="tTInfoDetailServiceFacadeImpl" check="false" /> | ||
| 23 | + <!-- 日志服务 --> | ||
| 24 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.log.LogServiceFacade" id="logServiceFacadeImpl" check="false" /> | ||
| 25 | + | ||
| 26 | + <!-- 排班计划查询服务 --> | ||
| 27 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanServiceFacade" id="planServiceFacadeImpl" check="false" /> | ||
| 28 | + <!-- 排班明细查询服务 --> | ||
| 29 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanInfoServiceFacade" id="planInfoServiceFacadeImpl" check="false" /> | ||
| 30 | + <!-- 排班前置验证服务 --> | ||
| 31 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade" id="planPreValidateFacadeImpl" check="false" /> | ||
| 32 | + <!-- 排班生成服务 --> | ||
| 33 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanGenerateFacade" ref="planGenerateFacadeImpl" check="false" /> | ||
| 34 | + | ||
| 35 | +</beans> |
src/main/resources/dubbo/config-dev.properties
| 1 | -# application名字 | ||
| 2 | -spring.dubbo.application.name=bsth_control_v2 | ||
| 3 | -# zookeeper注册中心地址 | ||
| 4 | -spring.dubbo.registry=zookeeper://127.0.0.1:2181 | ||
| 5 | - | ||
| 6 | -#----------- dubbo:consumer 性能调优选项 -------------# | ||
| 7 | -# 远程服务调用超时时间,单位毫秒,这里设置30分钟 | ||
| 8 | -spring.dubbo.consumer.timeout=1800000 | ||
| 9 | -# 远程服务调用重试次数,0表示不需要重试 | ||
| 10 | -spring.dubbo.consumer.retries=0 | ||
| 11 | -#----------- dubbo:consumer 服务治理选项 -------------# | ||
| 12 | -# 启动不检查提供者是否存在 | ||
| 13 | -spring.dubbo.consumer.check=false | ||
| 14 | \ No newline at end of file | 1 | \ No newline at end of file |
| 2 | +# application名字 | ||
| 3 | +spring.dubbo.application.name=bsth_control_v_multi_service | ||
| 4 | +# zookeeper注册中心地址 | ||
| 5 | +spring.dubbo.registry=zookeeper://127.0.0.1:2181 | ||
| 6 | + | ||
| 7 | +#----------- dubbo:consumer 性能调优选项 -------------# | ||
| 8 | +# 远程服务调用超时时间,单位毫秒,这里设置30分钟 | ||
| 9 | +spring.dubbo.consumer.timeout=1800000 | ||
| 10 | +# 远程服务调用重试次数,0表示不需要重试 | ||
| 11 | +spring.dubbo.consumer.retries=0 | ||
| 12 | +#----------- dubbo:consumer 服务治理选项 -------------# | ||
| 13 | +# 启动不检查提供者是否存在 | ||
| 14 | +spring.dubbo.consumer.check=false |
src/main/resources/dubbo/config-prod.properties
| 1 | -# application名字 | ||
| 2 | -spring.dubbo.application.name=bsth_control_v2 | ||
| 3 | -# zookeeper注册中心地址 | ||
| 4 | -spring.dubbo.registry=zookeeper://127.0.0.1:2181 | ||
| 5 | - | ||
| 6 | -#----------- dubbo:consumer 性能调优选项 -------------# | ||
| 7 | -# 远程服务调用超时时间,单位毫秒,这里设置30分钟 | ||
| 8 | -spring.dubbo.consumer.timeout=1800000 | ||
| 9 | -# 远程服务调用重试次数,0表示不需要重试 | ||
| 10 | -spring.dubbo.consumer.retries=0 | ||
| 11 | -#----------- dubbo:consumer 服务治理选项 -------------# | ||
| 12 | -# 启动不检查提供者是否存在 | ||
| 13 | -spring.dubbo.consumer.check=false | 1 | +# application名字 |
| 2 | +spring.dubbo.application.name=bsth_control_v_multi_service | ||
| 3 | +# zookeeper注册中心地址 | ||
| 4 | +spring.dubbo.registry=zookeeper://127.0.0.1:2181 | ||
| 5 | + | ||
| 6 | +#----------- dubbo:consumer 性能调优选项 -------------# | ||
| 7 | +# 远程服务调用超时时间,单位毫秒,这里设置30分钟 | ||
| 8 | +spring.dubbo.consumer.timeout=1800000 | ||
| 9 | +# 远程服务调用重试次数,0表示不需要重试 | ||
| 10 | +spring.dubbo.consumer.retries=0 | ||
| 11 | +#----------- dubbo:consumer 服务治理选项 -------------# | ||
| 12 | +# 启动不检查提供者是否存在 | ||
| 13 | +spring.dubbo.consumer.check=false |