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.

질문됨 2년 전983회 조회
1개 답변
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
전문가
James_S
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠