2funny

Results 1 comments of 2funny

应该是服务提供者启动时和@value注入时,都会调用一次RandomValuePropertySource的getRandomValue生成一次随机值导致的问题吧,如果用ApplicationContext.getEnvironment().getProperty(server.port) 测试的话就会发现,每次都会生成一个随机值,想要固定的话,只能手写一个PropertySource了