feign.Feign.builder()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(1147)

本文整理了Java中feign.Feign.builder()方法的一些代码示例,展示了Feign.builder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feign.builder()方法的具体详情如下:
包路径:feign.Feign
类名称:Feign
方法名:builder

Feign.builder介绍

暂无

代码示例

代码示例来源:origin: yu199195/Raincat

@Bean
@Scope("prototype")
public Feign.Builder feignBuilder() {
  return Feign.builder().requestInterceptor(new RestTemplateInterceptor());
}

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

static Feign.Builder builder(BeanFactory beanFactory) {
    return Feign.builder().client(new FescarFeignClient(beanFactory));
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-sleuth

static Feign.Builder builder(BeanFactory beanFactory) {
  return Feign.builder().retryer(Retryer.NEVER_RETRY).client(client(beanFactory));
}

代码示例来源:origin: zpng/spring-cloud-7simple

@Bean
@Scope("prototype")
public Feign.Builder feignBuilder() {
  return Feign.builder();
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-openfeign-core

@Bean
@Scope("prototype")
@ConditionalOnMissingBean
public Feign.Builder feignBuilder(Retryer retryer) {
  return Feign.builder().retryer(retryer);
}

代码示例来源:origin: spring-cloud/spring-cloud-openfeign

@Bean
@Scope("prototype")
@ConditionalOnMissingBean
public Feign.Builder feignBuilder(Retryer retryer) {
  return Feign.builder().retryer(retryer);
}

代码示例来源:origin: kloiasoft/eventapis

@Bean
public Feign.Builder feignBuilder(@Autowired List<RequestInterceptor> interceptors) {
  return Feign.builder()
      .requestInterceptors(interceptors);
}

代码示例来源:origin: wso2/msf4j

public Feign.Builder newFeignClientBuilder() {
  return Feign.builder()
      .encoder(encoder)
      .decoder(decoder);
}

代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.core

/**
 * Create and return OAuth2 revoke service stubs
 *
 * @return OAuth2 revoke service stub
 * @throws APIManagementException if error occurs while crating OAuth2 revoke service stub
 */
public OAuth2ServiceStubs.RevokeServiceStub getRevokeServiceStub() throws APIManagementException {
  return Feign.builder()
      .encoder(new FormEncoder())
      .client(new Client.Default(AMSSLSocketFactory.getSSLSocketFactory(kmCertAlias),
          (hostname, sslSession) -> true))
      .target(OAuth2ServiceStubs.RevokeServiceStub.class, revokeEndpoint);
}

代码示例来源:origin: wso2/carbon-apimgt

/**
 * Create and return OAuth2 revoke service stubs
 *
 * @return OAuth2 revoke service stub
 * @throws APIManagementException if error occurs while crating OAuth2 revoke service stub
 */
public OAuth2ServiceStubs.RevokeServiceStub getRevokeServiceStub() throws APIManagementException {
  return Feign.builder()
      .encoder(new FormEncoder())
      .client(new Client.Default(AMSSLSocketFactory.getSSLSocketFactory(kmCertAlias),
          (hostname, sslSession) -> true))
      .target(OAuth2ServiceStubs.RevokeServiceStub.class, revokeEndpoint);
}

代码示例来源:origin: com.mesosphere/marathon-client

private static DCOS buildInstance(String endpoint, Consumer<Feign.Builder> customize) {
  GsonDecoder decoder = new GsonDecoder(ModelUtils.GSON);
  GsonEncoder encoder = new GsonEncoder(ModelUtils.GSON);
  Feign.Builder builder = Feign.builder()
                 .encoder(encoder)
                 .decoder(decoder)
                 .errorDecoder(new DCOSErrorDecoder());
  customize.accept(builder);
  builder.requestInterceptor(new DCOSAPIInterceptor());
  return builder.target(DCOS.class, endpoint);
}

代码示例来源:origin: org.bitbucket.askllc.fermenter.stout/stout-cookbook-domain-client

/**
 * Creates baseline resource builder which can be used to configure specific resources.
 * 
 * @return Baseline builder
 */
protected Feign.Builder feignBuilder() {
  return Feign.builder().errorDecoder(new FeignErrorTranslator()).decoder(feignDecoder()).encoder(feignEncoder())
      .logger(new Slf4jLogger(getClass())).requestInterceptor(new HeaderInterceptorForwarder());
}

代码示例来源:origin: apache/karaf-cellar

@Override
public void signIn() {
  final Feign.Builder builder = Feign.builder()
    .logger(new Slf4jLogger())
    .decoder(new GsonDecoder());
  if(this.etcdUsername != null && this.etcdPassword != null) {
    builder.requestInterceptor(
      new BasicAuthRequestInterceptor(this.etcdUsername, this.etcdPassword));
  }
  this.etcdService = builder.target(EtcdService.class, this.etcdEnpoint);
}

代码示例来源:origin: 417511458/jbone

@Bean
public TagApi getTagApi(Decoder decoder, Encoder encoder, Client client) {
  TagApi tagApi = Feign.builder().client(client)
      .encoder(encoder)
      .decoder(decoder)
      .contract(new SpringMvcContract())
      .target(TagApi.class, jboneConfiguration.getRpc().getTagServer().getFeign().getProtocol() + "://" + jboneConfiguration.getRpc().getTagServer().getFeign().getName().toUpperCase());
  return tagApi;
}

代码示例来源:origin: howtoprogram/Java-Examples

public AuthStatus getAuthenticatedUser() {
  BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor(USERNAME,
      PASSWORD);
  HttpBinResource bookResource = Feign.builder().encoder(new JacksonEncoder())
      .decoder(new JacksonDecoder()).requestInterceptor(interceptor)
      .target(HttpBinResource.class, HTTP_BIN_URL);
  return bookResource.getAuthenticatedUser();
}

代码示例来源:origin: mohitsoni/marathon-client

public static Marathon getInstance(String endpoint) {
    GsonDecoder decoder = new GsonDecoder(ModelUtils.GSON);
    GsonEncoder encoder = new GsonEncoder(ModelUtils.GSON);
    return Feign.builder().encoder(encoder).decoder(decoder)
        .errorDecoder(new MarathonErrorDecoder())
        .requestInterceptor(new MarathonHeadersInterceptor())
        .target(Marathon.class, endpoint);
  }
}

代码示例来源:origin: org.wso2.carbon.analytics-common/org.wso2.carbon.analytics.idp.client

public <T> T buildWithoutInterceptor(int connectTimeoutMillis, int readTimeoutMillis, Class<T> target, String url) {
  return Feign.builder()
      .encoder(new Encoder.Default()).decoder(new GsonDecoder())
      .options(new Request.Options(connectTimeoutMillis, readTimeoutMillis))
      .client(newDefaultClientInstance())
      .target(target, url);
}

代码示例来源:origin: palantir/conjure-java-runtime

private static TestEchoService createTestService(SslConfiguration sslConfig) {
  SSLSocketFactory factory = SslSocketFactories.createSslSocketFactory(sslConfig);
  X509TrustManager trustManager = SslSocketFactories.createX509TrustManager(sslConfig);
  String endpointUri = "https://localhost:" + APP.getLocalPort();
  OkHttpClient okHttpClient = new OkHttpClient.Builder().sslSocketFactory(factory, trustManager).build();
  return Feign.builder()
      .client(new feign.okhttp.OkHttpClient(okHttpClient))
      .contract(new JAXRSContract())
      .target(TestEchoService.class, endpointUri);
}

代码示例来源:origin: org.wso2.carbon.analytics-common/org.wso2.carbon.analytics.idp.client

public <T> T build(String username, String password, int connectTimeoutMillis,
          int readTimeoutMillis, Class<T> target, String url) {
  return Feign.builder().requestInterceptor(new BasicAuthRequestInterceptor(username, password))
      .encoder(new Encoder.Default()).decoder(new Decoder.Default())
      .options(new Request.Options(connectTimeoutMillis, readTimeoutMillis))
      .client(newDefaultClientInstance())
      .target(target, url);
}

代码示例来源:origin: com.societegenerale.ci-droid.tasks-consumer/ci-droid-tasks-consumer-infrastructure

static Feign.Builder buildGitReferenceClient(String oauthToken) {
    return Feign.builder()
        .logger(new Slf4jLogger(GitReferenceClient.class))
        .encoder(new JacksonEncoder())
        .decoder(new JacksonDecoder())
        .errorDecoder(new BranchCreationErrorDecoder())
        .requestInterceptor(new OAuthInterceptor(oauthToken))
        .logLevel(Logger.Level.FULL);
  }
}

相关文章