spring-cloud-netflix

Spring 5 Functional Web Framework is not working with Eureka Client

心不动则不痛 提交于 2019-12-08 14:19:44
问题 Spring 5 Functional Web Framework is not working when I enable Microservice environment { Config-Server, Service-Registry(Eureka), Gateway(Zuul) } I've a Maven + Spring Boot(v. 2.0.0.M3) + Spring Cloud(v. Finchley.M2) + JDO (DataNucleus) + MySQL application with Annotation based Rest Controller as well as Web Functional based RouterFunction. When I run my application Without Eureka Client Dependency. Everything works fine, My Annotation based & Functional calls working smoothly.. <dependency>

NoClassDefFoundError: NameCoder at Spring Cloud Brixton.SR7 and Spring Cloud Camden.SR3

旧时模样 提交于 2019-12-08 14:00:04
问题 For all the Camden releases and now on the Brixton.SR7 as well, the following issue related to the Eureka Client occurs when starting the Spring Boot app: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/naming/NameCoder For an instance I have a Spring Boot app having the @EnableDiscoveryClient annotation... Lately I’ve been changing the Spring Cloud dependencies back to Brixton.SR6 in order to get rid of this error. Certainly, I want to use the latest versions of the Spring Cloud

Spring cloud - Resttemplate doesn't get injected in interceptor

假如想象 提交于 2019-12-08 09:39:18
问题 I created a resttemplate in my spring boot application like this: @Configuration public class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); } } This works fine in all classes when autowired. However, in my interceptor, this throws up nullpointer exception. What could be the reason and how can I configure a loadbalanced (using Ribbon) resttemplate in my interceptor? Update: my interceptor: public class MyInterceptor implements

Create a Custom Spring Cloud Netflix Ribbon Client

我与影子孤独终老i 提交于 2019-12-08 08:04:09
问题 I am using Spring Cloud Netflix Ribbon in combination with Eureka in a Cloud Foundry environment. The use case I am trying to implement is the following: I have a running CF application named address-service with several instances spawned. The instances are registering to Eureka by the service name address-service I have added custom metadata to service instances using eureka.instance.metadata-map.applicationId: ${vcap.application.application_id} I want to use the information in Eureka's

How to activate /turbine.stream endpoint in a standalone Turbine application

坚强是说给别人听的谎言 提交于 2019-12-08 07:37:51
问题 I am trying to create a standalone application to collect Hystrix stream from other applications. But it does not expose the /turbine.stream endpoint by default. I am sure what is missing in my project. Spring Boot: 2.0.4.RELEASE, Spring Cloud: Finchley.SR1 The application class: @SpringBootApplication @EnableDiscoveryClient @EnableTurbine public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } The content of applicaiton

Eureka Renews threshold & Renews (last min)

∥☆過路亽.° 提交于 2019-12-06 12:34:27
问题 I have one Eureka Server A and two client instances of B(Client3) and C(Client4) I got logs from Eureka Server, which are as follows : 2018-01-25 12:56:27.828 INFO 7145 --- [nio-8765-exec-2] c.n.e.registry.AbstractInstanceRegistry : Registered instance CLIENT3/client3:bb488bb73fd313321e393915f746bfe5 with status UP (replication=false) 2018-01-25 12:56:28.417 INFO 7145 --- [nio-8765-exec-3] c.n.e.registry.AbstractInstanceRegistry : Registered instance CLIENT3/client3

Is it possible to use Spring API Gateway for threat protection?

扶醉桌前 提交于 2019-12-06 06:18:32
问题 I'm going to implement API Gateway using Netflix Zuul. Is it possible to setup any rules for protection against: SQL Injection, XML Threat Protection JSON Threat Protection I found only external solution (API Gateways) supporting it :( 来源: https://stackoverflow.com/questions/52422198/is-it-possible-to-use-spring-api-gateway-for-threat-protection

how to create multiple instances of eureka services registered into eureka service registry?

拟墨画扇 提交于 2019-12-06 02:35:07
问题 I have created eureka service registry and registered services into that. Currently only one instance of a service is running. How to add multiple instances of a same service? I am developing standalone application. And I am accessing services through Rest Template.I am following https://spring.io/guides/gs/service-registration-and-discovery/ 回答1: Each instance would need to have a unique instanceId , normally configured in application.yml using: ... eureka: instance: metadataMap: instanceId:

How to disable eureka lookup on specific @FeignClient

跟風遠走 提交于 2019-12-05 17:38:09
I have a microservice that uses @FeignClient predominantly to talk to other micro-services. This works beautifuly using Eureka's service discovery mechanism. Now I have a pressing need to use a @FeignClient to connect to an external system and still perform load balancing using configurations as shown below. Feign client : @FeignClient("externalServers") public interface ExternalServersClient { @RequestMapping(method = RequestMethod.GET, value = "/someExternalUrl") ResponseEntity<Object> callExternalServer(); } application.yml : externalServers: ribbon: listOfServers: server1:18201,server2

spring-boot Autowired DiscoveryClient RestTemplate UnknownHostException

喜夏-厌秋 提交于 2019-12-05 16:25:11
I'm using spring boot 1.3.3 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> Edit I'm using Brixton.RC1 for my spring cloud dependencies <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Brixton.RC1</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> My Application is setup with these