0

I have the following to initialize a static client...

public class Boostrap implements BootstrapRegistryInitializer {

    @Override
    public void initialize(BootstrapRegistry registry) {
        // TODO: Get the username from properties
        String username = "MyUser";
        registry.register(
            AwsParameterStoreClientCustomizer.class,
            context -> new ParameterStoreClientCustomizer(username)
        );
        registry.register(BootstrapItem.class, context -> new BootstrapItem("Test 123"));
    }
}

I would like to get username from myProps.username so my application.yml file will look like this...

myProps:
  username: Test345

I want to use the application.yml instead of the bootstrap.yml because I would like to share these properties between the bootstrap and application contexts (IE. 1 place instead of 2).

What is the proper way to access the application yaml property from the BootstrapRegistryInitializer?

JGleason
  • 3,067
  • 6
  • 20
  • 54

0 Answers0