package com.bushuo.eurekaconsumer.service;
import com.bushuo.eurekaconsumer.config.HystrixConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
//
//import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.web.client.RestTemplate;
//
//@Service
//public class LocalItemService {
// @Autowired
// private RestTemplate restTemplate;
// @HystrixCommand(fallbackMethod = "demoError")
// public String demo(String name){
// return restTemplate.getForObject( "http://eureka-provider/demo?name="+name,String.class );
//
// }
// public String demoError(String name){
// return String.format( "your message is : %s but request bat.", name);
// }
//}
@FeignClient(value = "eureka-provider",
configuration = HystrixConfig.class,
fallback = LocalbushuoServiceImpl.class)
public interface LocalbushuoService {
@RequestMapping(value = "/demo",method = RequestMethod.GET )
public String demo(@RequestParam(value = "name") String name);
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Spring Cloud :Hystrix实现优雅的服务容错 (306个子文件)
$PRODUCT_WORKSPACE_FILE$ 489B
TextJustifier.class 3KB
TextJustifier.class 3KB
LocalItemService.class 1KB
EurekaConsumerApplication.class 976B
LocalIbushuoController.class 973B
LocalItemController.class 956B
HystrixController.class 929B
HystrixController.class 929B
EurekaConsumerApplication.class 913B
EurekaProviderApplication.class 849B
EurekaProviderApplication.class 849B
LocalbushuoServiceImpl.class 827B
EurakeApplication.class 816B
EurakeApplication.class 816B
LocalbushuoService.class 801B
HystrixConfig.class 737B
HystrixConfig.class 737B
EurekaConsumerApplicationTests.class 579B
EurekaProviderApplicationTests.class 579B
EurekaConsumerApplicationTests.class 579B
EurekaProviderApplicationTests.class 579B
EurakeApplicationTests.class 540B
EurakeApplicationTests.class 540B
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
mvnw.cmd 7KB
.gitignore 395B
.gitignore 395B
.gitignore 395B
.gitignore 395B
.gitignore 395B
.gitignore 395B
.gitignore 395B
.gitignore 395B
eureka-consumer.iml 18KB
eurake.iml 17KB
eurake (1).iml 17KB
eurake.iml 17KB
eurake (1).iml 17KB
eureka-consumer (1).iml 17KB
eureka-consumer (1).iml 17KB
eureka-consumer.iml 16KB
eureka-provider.iml 16KB
eureka-provider (1).iml 16KB
eureka-provider (1).iml 16KB
eureka-provider.iml 16KB
hystrix-1.iml 7KB
hystrix-2.iml 7KB
LocalbushuoService.java 1KB
LocalItemService.java 716B
EurekaConsumerApplication.java 597B
LocalIbushuoController.java 543B
LocalItemController.java 532B
EurekaConsumerApplication.java 514B
EurakeApplication.java 486B
EurakeApplication.java 486B
HystrixConfig.java 448B
HystrixConfig.java 448B
EurekaProviderApplication.java 435B
EurekaProviderApplication.java 435B
HystrixController.java 375B
HystrixController.java 375B
Hystrix2Application.java 329B
LocalbushuoServiceImpl.java 313B
EurekaConsumerApplicationTests.java 234B
EurekaProviderApplicationTests.java 234B
EurekaConsumerApplicationTests.java 234B
EurekaProviderApplicationTests.java 234B
Hystrix2ApplicationTests.java 222B
EurakeApplicationTests.java 219B
EurakeApplicationTests.java 219B
eurake (1).kotlin_module 16B
eurake (1).kotlin_module 16B
eureka-consumer (1).kotlin_module 16B
eureka-consumer (1).kotlin_module 16B
eureka-provider (1).kotlin_module 16B
eureka-provider (1).kotlin_module 16B
eureka-consumer (1).kotlin_module 16B
eureka-consumer.kotlin_module 16B
eureka-consumer (1).kotlin_module 16B
eureka-provider (1).kotlin_module 16B
eureka-provider (1).kotlin_module 16B
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
HELP.md 1KB
mvnw 10KB
mvnw 10KB
mvnw 10KB
mvnw 10KB
共 306 条
- 1
- 2
- 3
- 4
资源评论
布说在见
- 粉丝: 6567
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功