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

feature add Quarkus integration #1444

Closed
wants to merge 7 commits into from
Closed

Conversation

seasidesky
Copy link
Contributor

@seasidesky seasidesky commented Apr 29, 2020

Describe what this PR does / why we need it

feature add Quarkus integration

Does this pull request fix one issue?

fix #1233

Describe how you did it

  • add sentinel-annotation-cdi-interceptor to support @SentinelResourceBinding for CDI, corresponding to sentinel-annotation-aspectj and @SentinelResource
  • add sentinel-quarkus-adapter module, it provides sentinel-annotation-quarkus-adapter and sentinel-jax-rs-quarkus-adapter to adapt sentinel-annotation-cdi-interceptor and sentinel-jax-rs-adapter for quarkus. sentinel-quarkus-adapter also provides sentinel-native-image-quarkus-adapter to support running sentinel with quarkus in native image mode.
  • for demos, sentinel-demo-annotation-cdi-interceptor and sentinel-demo-quarkus are added

Describe how to verify it

all test run pass

Special notes for reviews

  • native image test is covered in sentinel-demo-quarkus
  • sentinel-native-image-quarkus-adapter currently rely on sentinel-logging-slf4j to make sentinel run in native image mode easily, because quarkus-core provides Target_org_slf4j_LoggerFactory to substitue getLogger method.sentinel-transport-simple-http can work in native image mode, while sentinel-transport-netty-http cannot work in native image mode without extra config or substitutions.
  • besides quarkus native image support, spring also has an experimental project spring-graal-native, we can also pay attention to it.

@sczyh30 sczyh30 added area/integrations Issues or PRs related to integrations with open-source components kind/feature Category issues or prs related to feature request. size/XXL Indicate a PR that changes 1000+ lines. to-review To review labels Apr 29, 2020
@sczyh30 sczyh30 self-requested a review April 29, 2020 16:04
@@ -0,0 +1,9 @@
# references for build native image or AOT
Copy link
Member

Choose a reason for hiding this comment

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

Could you please update the README?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@seasidesky
Copy link
Contributor Author

@sczyh30 native image is supported. native image test is currently added in sentinel-demo-quarkus. just run mvn verify -Pnative (require graalvm installed and native image installed) .
if needed, i can add this native image verification to ci files.

@codecov-io
Copy link

codecov-io commented May 12, 2020

Codecov Report

Merging #1444 into master will increase coverage by 0.62%.
The diff coverage is 71.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1444      +/-   ##
============================================
+ Coverage     43.80%   44.42%   +0.62%     
- Complexity     1703     1775      +72     
============================================
  Files           372      378       +6     
  Lines         10605    10828     +223     
  Branches       1414     1454      +40     
============================================
+ Hits           4645     4810     +165     
- Misses         5393     5432      +39     
- Partials        567      586      +19     
Impacted Files Coverage Δ Complexity Δ
...nterceptor/AbstractSentinelInterceptorSupport.java 64.49% <64.49%> (ø) 38.00 <38.00> (?)
...tion/cdi/interceptor/ResourceMetadataRegistry.java 79.16% <79.16%> (ø) 12.00 <12.00> (?)
...n/cdi/interceptor/SentinelResourceInterceptor.java 86.95% <86.95%> (ø) 5.00 <5.00> (?)
...ent/SentinelAnnotationQuarkusAdapterProcessor.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...ployment/SentinelJaxRsQuarkusAdapterProcessor.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...inel/annotation/cdi/interceptor/MethodWrapper.java 100.00% <100.00%> (ø) 6.00 <6.00> (?)
...dapter/gateway/common/rule/GatewayRuleManager.java 64.88% <0.00%> (-4.47%) 13.00% <0.00%> (ø%)
...e/src/main/java/com/alibaba/csp/sentinel/SphO.java 65.62% <0.00%> (ø) 14.00% <0.00%> (ø%)
...e/src/main/java/com/alibaba/csp/sentinel/SphU.java 57.14% <0.00%> (ø) 12.00% <0.00%> (ø%)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba39109...7b98d0f. Read the comment docs.

@sczyh30
Copy link
Member

sczyh30 commented May 12, 2020

Cool! I'll take a look these days :)

@sczyh30
Copy link
Member

sczyh30 commented Jun 12, 2020

@seasidesky Could you please squash the PR to three commits:

  • One for adding sentinel-annotation-cdi-interceptor
  • One for adding sentinel-quarkus-adapter
  • One for adding demo

@CLAassistant
Copy link

CLAassistant commented Jun 12, 2020

CLA assistant check
All committers have signed the CLA.

@seasidesky
Copy link
Contributor Author

@seasidesky Could you please squash the PR to three commits:

* One for adding `sentinel-annotation-cdi-interceptor`

* One for adding `sentinel-quarkus-adapter`

* One for adding demo

OK

@seasidesky
Copy link
Contributor Author

@sczyh30 split to three pull requests

@sczyh30 sczyh30 removed the to-review To review label Jun 16, 2020
@sczyh30
Copy link
Member

sczyh30 commented Jun 16, 2020

Closing this PR as #1541, #1542 and #1543 have been merged.

@sczyh30 sczyh30 closed this Jun 16, 2020
CST11021 pushed a commit to CST11021/Sentinel that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/feature Category issues or prs related to feature request. size/XXL Indicate a PR that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Integration module for Quarkus
4 participants