java - 无法设置此响应实体方法
问题描述
@HystrixCommand(commandKey = "MyHystrixCommand", fallbackMethod = "myHystrixFallback", threadPoolKey = "ThreadPoolKey")
public ResponseEntity<String> getServiceCallResponse(String serviceUrl, HttpEntity<?> entity) {
ResponseEntity<String> resp = null;
try {
resp = restTemplate.exchange(serviceUrl, HttpMethod.POST, entity, String.class)
.getBody();
}
catch(Exception e) {
handleExceptionForHystrix("getServiceCallResponse", e);
}
return resp;
}
设置 resp 时出错,说它不匹配。无法理解为什么会这样。有什么可以替代的。
解决方案
推荐阅读
- r - 用 NA 替换 # 并将值转换为 R 中的数字
- javascript - VueJS数据绑定对象样式不起作用
- c# - 如何使用 EF Core、Code First 将自动分配的 DateTime2 数据类型更改为 DateTime?
- r - 为特定 Linux 风格预编译 R 包
- python - 为什么我的 Python 脚本不提示用户输入?
- r - 在同一图上绘制密度图和散点图
- r - 如何根据另一个数据框中的部分字符串匹配向一个数据框添加一列?
- c# - 使用协程淡入/淡出 TextMeshPro 文本元素
- firebase - Sendgrid 和 Firebase 函数:发送带有动态模板数据的事务性电子邮件时出错
- html - 我怎样才能让一个div占据全身高度