awssdk.services.appconfig.model.BadRequestException

0

hello, in my server,where i use AppConfig sdk ,it's show this error:

software.amazon.awssdk.services.appconfig.model.BadRequestException: Feature flag configurations must be accessed via AWS AppConfig Data's GetLatestConfiguration API. (Service: AppConfig, Status Code: 400, Request ID: 412ba838-95d0-4877-a8a6-c3352bb6731c, Extended Request ID: null)

I have already setup at the backup of website of aws, and there are: appConfig: application: example environment: example configuration: example

can u help me how to setting my java code or give the example guide code for me.

asked 2 years ago972 views
1 Answer
0

Using the Feature Flags configuration type means you need to use the new AppConfigData API instead of the original AppConfig API. The new API works in a slightly different way to the old one:

  • You must call startConfigurationSession before you do anything else with the service. This API call takes the application, environment and profile ids, and returns an initialConfigurationToken, which your application should store.
  • To receive the configuration initially, you call getLatestConfiguration, to which you should pass the stored configuration token. The response to this includes a nextPollConfigurationToken which your application should store. It also includes nextPollIntervalInSeconds, which is the number of seconds your application should wait before requesting the configuration again.
  • You can now call getLatestConfiguration to check for configuration updates. You should supply the most recent nextPollConfigurationToken you received, and store the new one you get in the response to this call. Note that if the configuration has not changed since you last received it, the configuration in the response will be blank. You will also receive a new nextPollIntervalInSeconds (which may be the same value as before), so you should track the new value.

I don't have a Java code sample I'm afraid, but the AppConfig docs show the API call flow using the CLI: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html

There's also a sample Python AppConfig helper library which implements this API version, which you may find useful to see how it interacts with it: https://github.com/aws-samples/sample-python-helper-aws-appconfig/blob/main/appconfig_helper/appconfig_helper.py

profile pictureAWS
EXPERT
James_S
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions