学无先后,达者为师

网站首页 编程语言 正文

报错:Error occurred when invoke the listener‘s interface!

作者:weixin_44654264 更新时间: 2022-01-18 编程语言

1、禁用Feign里面的Hystrix

feign:
  hystrix:
    enabled: false

2、将feign和controller加上对应的参数name

feign

@FeignClient(name="content")
@RequestMapping("/content")
public interface ContentFeign {

    @GetMapping(value = "/list/category/{id}")
    Result<List<Content>> findByCategory(@PathVariable(name = "id") Long id);
}

controller

@RestController
@RequestMapping("/content")
@CrossOrigin
public class ContentController {

   //根据分类id查询广告数据
    @GetMapping("/list/category/{id}")
    public Result<List<Content>> findByCategory(@PathVariable(name = "id") Long id){

        List<Content> contents = contentService.findByCategory(id);

        return new Result<List<Content>>(true,StatusCode.OK,"查询成功",contents);
    }
}

最后成功解决!!

redis成功加载数据

原文链接:https://blog.csdn.net/weixin_44654264/article/details/118400568

栏目分类
最近更新