Skip to content

fix: register and clean up API runtime resources(#6716) - #7017

Open
juicewcode wants to merge 1 commit into
apache:masterfrom
juicewcode:fix/6716-api-register-cleanup
Open

fix: register and clean up API runtime resources(#6716)#7017
juicewcode wants to merge 1 commit into
apache:masterfrom
juicewcode:fix/6716-api-register-cleanup

Conversation

@juicewcode

Copy link
Copy Markdown
Contributor

Fixes #6716

Summary

  • Invoke register after a successful API creation so the related selector/rule/metadata data is published.
  • Invoke removeRegister after successful API deletion.
  • Apply the same cleanup when deleting APIs by path, HTTP method, and RPC type.
  • Guard registration when required API extension data is missing.
  • Add unit tests for cleanup and non-existent API deletion.

Test

  • Added testDeleteCleansRegisteredResources to verify rule, selector, and metadata cleanup.
  • Added testDeleteWhenApiDoesNotExist to verify the expected missing-API response.
  • Existing API create/update/find/list tests remain applicable.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

  - After the API is created successfully, call the 'register' function to publish the associated selector/rule/metadata.
  - After the API is deleted successfully, call the 'removeRegister' function to clean up the associated runtime data.
  - When deleting by API path, the cleanup is executed synchronously.
  - Add protection for cases where extension data or context path is missing.
  - Add tests for API deletion cleanup and scenarios where the API does not exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ApiServiceImpl removeRegister/register are dead code; delete() leaves orphan selector/rule/metadata

1 participant