spring-cloud

Spring Cloud Gateway or Zuul2, Which one is the right replacement for Zuul1?

纵然是瞬间 提交于 2020-08-03 03:51:06
问题 Since Spring Cloud team has abandoned development of Zuul module, we are moving to Spring Cloud Gateway or Zuul2 but I believe Zuul2 needs a lot of changes in the architecture and needs big changes in the microservices(correct me if i'm wrong), can anyone gives a recommendation on zuul2 or Spring-Cloud-Gateway, has anyone or you know any big player in tech using Spring-Cloud-Gateway? 回答1: Zuul1 is blocking whereas Zuul2 and spring cloud gateway are non-blocking and this is a major performance

spring cloud aws multiple sqs listener

▼魔方 西西 提交于 2020-07-20 17:02:11
问题 There are 2 sqs listener in my project. I want one of them to have the same setting and one of them different setting. The only value I want to change is maxNumberOfMessages. What is the most practical way to do this ? ı want set different maxNumberOfMessages value for one of listener. this is my config ; @Bean public AWSCredentialsProvider awsCredentialsProvider(@Value("${cloud.aws.profile}") String profile, @Value("${cloud.aws.region.static}") String region, @Value("${cloud.aws.roleArn}")

spring cloud aws multiple sqs listener

孤街浪徒 提交于 2020-07-20 17:00:51
问题 There are 2 sqs listener in my project. I want one of them to have the same setting and one of them different setting. The only value I want to change is maxNumberOfMessages. What is the most practical way to do this ? ı want set different maxNumberOfMessages value for one of listener. this is my config ; @Bean public AWSCredentialsProvider awsCredentialsProvider(@Value("${cloud.aws.profile}") String profile, @Value("${cloud.aws.region.static}") String region, @Value("${cloud.aws.roleArn}")

spring cloud aws multiple sqs listener

自闭症网瘾萝莉.ら 提交于 2020-07-20 17:00:35
问题 There are 2 sqs listener in my project. I want one of them to have the same setting and one of them different setting. The only value I want to change is maxNumberOfMessages. What is the most practical way to do this ? ı want set different maxNumberOfMessages value for one of listener. this is my config ; @Bean public AWSCredentialsProvider awsCredentialsProvider(@Value("${cloud.aws.profile}") String profile, @Value("${cloud.aws.region.static}") String region, @Value("${cloud.aws.roleArn}")

Spring cloud Eureka server is NOT replicating each other, displaying warning

廉价感情. 提交于 2020-06-18 12:26:33
问题 I am using two Eureka server in spring cloud to replicate each other, when I open the page at http://localhost:8761, I saw this message: RENEWALS ARE LESSER THAN THE THRESHOLD. THE SELF PRESERVATION MODE IS TURNED OFF.THIS MAY NOT PROTECT INSTANCE EXPIRY IN CASE OF NETWORK/OTHER PROBLEMS. The eureka application.xml is this: server: port: ${server.instance.port:5678} spring: application: name: nodeservice sidecar: port: ${nodeserver.instance.port:3000} health-uri: http://localhost:${nodeserver

Spring cloud Eureka server is NOT replicating each other, displaying warning

旧巷老猫 提交于 2020-06-18 12:23:50
问题 I am using two Eureka server in spring cloud to replicate each other, when I open the page at http://localhost:8761, I saw this message: RENEWALS ARE LESSER THAN THE THRESHOLD. THE SELF PRESERVATION MODE IS TURNED OFF.THIS MAY NOT PROTECT INSTANCE EXPIRY IN CASE OF NETWORK/OTHER PROBLEMS. The eureka application.xml is this: server: port: ${server.instance.port:5678} spring: application: name: nodeservice sidecar: port: ${nodeserver.instance.port:3000} health-uri: http://localhost:${nodeserver

@RefreshScope stops @Scheduled task

巧了我就是萌 提交于 2020-06-17 02:39:42
问题 I have a monitoring app wherein I am running a fixedRate task. This is pulling in a config parameter configured with Consul. I want to pull in updated configuration, so I added @RefreshScope. But as soon as I update the config value on Consul, the fixedRate task stops running. @Service @RefreshScope public class MonitorService { @Autowired private AppConfig appConfig; @PostConstruct public void postConstRun() { System.out.println(appConfig.getMonitorConfig()); } @Scheduled(fixedRate = 1000)

Could not decode json type for key: file_name in a Spring Cloud Data Flow stream

六眼飞鱼酱① 提交于 2020-06-16 19:32:52
问题 I use Spring Cloud Data Flow to set up a stream that read a CSV file, transform it using a custom processor and log it : stream create --name testsourcecsv --definition "file --mode=lines --directory=D:/toto/ --file.filename-pattern=adresses-28.csv --maxMessages=1000 | csvToMap --spring.cloud.stream.bindings.output.content-type=application/json | log --spring.cloud.stream.bindings.input.content-type=application/json" --deploy The file and csvToMap applications work fine, but in the log

How to POST form-url-encoded data with Spring Cloud Feign

北战南征 提交于 2020-06-09 17:04:47
问题 Using spring-mvc annotations, how can I define an @FeignClient that can POST form-url-encoded? 回答1: Use form encoder for feign: https://github.com/OpenFeign/feign-form and your feign configuration can look like this: class CoreFeignConfiguration { @Autowired private ObjectFactory<HttpMessageConverters> messageConverters @Bean @Primary @Scope(SCOPE_PROTOTYPE) Encoder feignFormEncoder() { new FormEncoder(new SpringEncoder(this.messageConverters)) } } Then, the client can be mapped like this:

Spring Cloud Stream 3.0.1 adding Channel Interceptor around @Input annotation

橙三吉。 提交于 2020-05-17 07:06:21
问题 I am looking for a way to intercept the @Input annotation and add an interceptor for my Subscribable Channel Something like below @Around("@annotation(org.springframework.cloud.stream.annotation.Input)") public Object interceptInput(ProceedingJoinPoint joinPoint) throws Throwable { LOG.debug("Intercepted @Input from method : {}", joinPoint.getSignature()); Object returnValue = null; try { returnValue = joinPoint.proceed(); // add the interceptor for input channel } catch (Exception e) { LOG