Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2022.x] Add SentinelProtectInterceptor AOT hints #3370

Merged
merged 5 commits into from
Jul 1, 2023

Conversation

ruansheng8
Copy link
Collaborator

Describe what this PR does / why we need it

mvn clean native:compile -Pnative

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@ruansheng8 ruansheng8 requested a review from steverao June 29, 2023 12:14
@ruansheng8
Copy link
Collaborator Author

也可以通过以下方式来查看是否正确生成相关的配置文件:

  1. mvn compile
  2. mvn spring-boot:process-aot -Pnative -Dstart-class=com.alibaba.cloud.examples.RestTemplateApplication
  3. 查看文件/target/spring-aot/main/resources/META-INF/native-image/com.alibaba.cloud/sentinel-resttemplate-example/reflect-config.json 可以看到对应的配置:
  {
    "name": "com.alibaba.cloud.sentinel.custom.SentinelProtectInterceptor",
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": [
          "com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate",
          "org.springframework.web.client.RestTemplate"
        ]
      }
    ]
  }

Copy link
Collaborator

@steverao steverao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add this PR to module of spring-cloud-starter-alibaba-sentinel.

@ruansheng8
Copy link
Collaborator Author

@steverao 改了一个版本,如果没有问题的话,后续其他模块就按照这种方式进行调整

@yuluo-yx
Copy link
Collaborator

@ruansheng8 I tested it locally and it works fine in my environment.

Copy link
Collaborator

@steverao steverao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ruansheng8

@steverao steverao merged commit 0d7dfc9 into alibaba:2022.x Jul 1, 2023
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.

3 participants