当前位置: 首页 > news >正文

网站开发计入会计 什么科目搜索引擎营销分类

网站开发计入会计 什么科目,搜索引擎营销分类,b2b网站建设成本,邯郸做网站找谁SpringCloud openFeign 之 获取被调用服务名 一. 概述 低版本 feign 只能获取到被调用方法的信息。 只有高版本 feign 才支持获取到被调用服务的信息。 二. 代码实现 package com.zxguan.springcloud2.template.user;import com.zxguan.springcloud2.template.user.config…

SpringCloud openFeign 之 获取被调用服务名

一. 概述

低版本 feign 只能获取到被调用方法的信息。

只有高版本 feign 才支持获取到被调用服务的信息。

二. 代码实现

package com.zxguan.springcloud2.template.user;import com.zxguan.springcloud2.template.user.config.TraceInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;@EnableEurekaClient
@EnableFeignClients(value = "com.zxguan", defaultConfiguration = TraceInterceptor.class)
@SpringBootApplication()
public class UserApplication {public static void main(String[] args) {SpringApplication.run(UserApplication.class, args);}}
@Component
public class TraceInterceptor implements RequestInterceptor {@Overridepublic void apply(RequestTemplate requestTemplate) {Target target =  requestTemplate.feignTarget();System.out.println("==============>" + target.name());}}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.2.8.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.zxguan.springcloud2.template</groupId><artifactId>user</artifactId><version>0.0.1-SNAPSHOT</version><name>user</name><description>Demo project for Spring Boot</description><properties><java.version>1.8</java.version><spring-cloud.version>Finchley.RELEASE</spring-cloud.version><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><dependencies>        <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-openfeign-core --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-openfeign-core</artifactId><version>2.2.10.RELEASE</version></dependency><!-- https://mvnrepository.com/artifact/io.github.openfeign/feign-core --><dependency><groupId>io.github.openfeign</groupId><artifactId>feign-core</artifactId><version>11.0</version></dependency><!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-openfeign</artifactId><version>2.2.10.RELEASE</version></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-configuration-processor</artifactId><optional>true</optional></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>18.0</version></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Finchley.RELEASE</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>
</project>

三. 特别注意

在升级 feign-core 版本后,可能会出现 java.lang.NoSuchMethodException 异常。这就说明有版本问题,此时需要定位到报错位置,将对应方法所属 jar 包调整到相应版本。

http://www.zhongyajixie.com/news/18676.html

相关文章:

  • 美国主机网站建设旅游网络营销的渠道有哪些
  • php做用户登录网站seo算法培训
  • 卓手机建网站百度网页pc版登录
  • 国内做微商城比较知名的网站足球世界积分榜
  • 美食网站怎么做p2p万能搜索引擎
  • 手机网站大全免费bing搜索引擎国际版
  • 惠州网站优化百度seo推广优化
  • 网站推广经验杂谈网络推广有哪些常见的推广方法
  • 百度怎么自己做网站竞价托管哪家公司好
  • 专门做网站的app口碑营销的概念
  • 西安做网站的哪家好百度百科优化排名
  • 宝塔面板做织梦网站万网域名注册查询网
  • linux vps网站搬家命令友情链接百科
  • 如何让一个网站排名掉十大推广app平台
  • 怎样给自己的网站做优化南宁网站制作
  • 做落地页的网站抖音权重查询
  • 制作相册影集app天津优化加盟
  • 从哪些方面做好网站的seoseo评测论坛
  • 安徽网站推广营销设计网络广告投放渠道有哪些
  • 企业营销网站建设落实好疫情防控优化措施
  • 做网站必须注册的商标seo网站推广案例
  • 网站优化推广方案十个有创意的线上活动
  • 屏显的企业网站应该怎么做949公社招聘信息
  • 网站群 米拓网站免费推广软件
  • 全球军事网站广东短视频seo搜索哪家好
  • 曲靖网站建设公司中国局势最新消息今天
  • dede地方门户网站模板外贸订单一般在哪个平台接
  • 江干区住房和城市建设局网站长沙整合推广
  • 购物网站毕业论文推广普通话的重要意义
  • 网站被加黑链google官方版下载