Spring boot configuration: how to return always same random value when referenced?
问题 I have the application property APP_ID that should be randomly generated (UUID) and that should have the same value for the entire Spring Boot application. What I did was the following: I defined in the application.properties file the APP_ID=${random.uuid} . The UUID gets created successfully, however for every property reference @Value("${APP_ID}") I will get a different UUID. Example: In class Foo I want to use the appId : @Value("${APP_ID}") private String appId; In class Bar I want to use