AWS Java SDK V2: Fetch list of Feature Flags including key and value

65 Views Asked by At

I am trying to fetch values from AppConfig Feature Flags by following the steps mentioned at https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html#API_appconfigdata_GetLatestConfiguration_Examples

Current functional code is as follows:

StartConfigurationSessionRequest session = new StartConfigurationSessionRequest()
                .withApplicationIdentifier(application)
                .withEnvironmentIdentifier(environment)
                .withConfigurationProfileIdentifier(configuration)
                .withRequiredMinimumPollIntervalInSeconds(15);
        String token = appDataConfigClient.startConfigurationSession(session).getInitialConfigurationToken();
        StartConfigurationSessionResult sessionResult = appDataConfigClient.startConfigurationSession(session).withInitialConfigurationToken(token);


        GetLatestConfigurationRequest getLatestConfigurationRequest = new GetLatestConfigurationRequest().withConfigurationToken(sessionResult.getInitialConfigurationToken());
        GetLatestConfigurationResult getLatestConfigurationResult = appDataConfigClient.getLatestConfiguration(getLatestConfigurationRequest);
        ByteBuffer configurationValue = getLatestConfigurationResult.getConfiguration();

        String converted = new String(configurationValue.array(), "UTF-8");

However, I am just receiving the list of values from the Feature Flags and not the list of keys associated with them. Is there a way to fetch the list of Feature Flags? The getConfiguration method in AppConfig SDK seems to be deprecated.

0

There are 0 best solutions below