我正在尝试在其中一个微服务中添加 Eureka 客户端,但我无法弄清楚如何使用 service-url。
我正在使用 spring-cloud 的 Greenwich.SR1 版本。
下面是我的application.yml
spring:
application:
name: stock-service
server:
port: 9901
eureka:
instance:
hostname: localhost
client:
register-with-eureka: true
fetch-registry: true
service-url: http://${eureka.instance.hostname}:9902/eureka/
Run Code Online (Sandbox Code Playgroud)
我尝试搜索它,但到处都在使用此版本不支持的旧方法:
老方法:
eureka: #tells about the Eureka server details and its refresh time
instance:
leaseRenewalIntervalInSeconds: 1
leaseExpirationDurationInSeconds: 2
client:
serviceUrl:
defaultZone: http://127.0.0.1:8761/eureka/
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?
我正在尝试处理无法满足流中的过滤条件的对象.
List<Integer> list = Arrays.asList(1,23,43,12,4,5);
list.stream().filter( i -> i > 10).collect(Collections.toList);
Run Code Online (Sandbox Code Playgroud)
这将返回大于10的Object列表.但我还想处理无法满足条件的对象(> 10).
谢谢.