Skip to content

provide sentinel-spring-webmvc-adapter - #1093

Closed
zhaoyuguang wants to merge 7 commits into
alibaba:masterfrom
zhaoyuguang:sentinel_spring_web_context1
Closed

provide sentinel-spring-webmvc-adapter#1093
zhaoyuguang wants to merge 7 commits into
alibaba:masterfrom
zhaoyuguang:sentinel_spring_web_context1

Conversation

@zhaoyuguang

@zhaoyuguang zhaoyuguang commented Oct 17, 2019

Copy link
Copy Markdown
Collaborator

resolve #1074

增加sentinel-spring-webmvc-adapter module
主要是提供继承HandlerInterceptorAdapter的SentinelHandlerInterceptor

不建议同时加载sentinel-web-servletsentinel-spring-webmvc-adapter
当这种case时:
因为sentinel-web-servlet的filter先于interceptor
使用Constants.SENTINEL_REQUEST_ATTR_WEB_SERVLET_ENABLE_KEY
当用户引用sentinel-web-servlet并加载filter时,标记此request被filter使用,
sentinel-spring-webmvc-adapter的SentinelHandlerInterceptor判断如果存在
就自动失效sentinel-spring-webmvc-adapter

@codecov-io

codecov-io commented Oct 17, 2019

Copy link
Copy Markdown

Codecov Report

Merging #1093 into master will increase coverage by 0.05%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1093      +/-   ##
============================================
+ Coverage      42.7%   42.76%   +0.05%     
- Complexity     1491     1492       +1     
============================================
  Files           319      319              
  Lines          9378     9382       +4     
  Branches       1279     1279              
============================================
+ Hits           4005     4012       +7     
+ Misses         4878     4877       -1     
+ Partials        495      493       -2
Impacted Files Coverage Δ Complexity Δ
.../main/java/com/alibaba/csp/sentinel/Constants.java 100% <ø> (ø) 1 <0> (ø) ⬇️
...sp/sentinel/adapter/servlet/CommonTotalFilter.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...aba/csp/sentinel/adapter/servlet/CommonFilter.java 85.36% <100%> (+0.75%) 10 <5> (ø) ⬇️
...a/csp/sentinel/slots/statistic/base/LeapArray.java 67.32% <0%> (-2.98%) 33% <0%> (-1%)
...tinel/slots/block/flow/param/ParamFlowChecker.java 55.4% <0%> (+2.7%) 29% <0%> (+1%) ⬆️
...p/sentinel/datasource/consul/ConsulDataSource.java 69.56% <0%> (+4.34%) 7% <0%> (ø) ⬇️
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 100% <0%> (+4.76%) 8% <0%> (+1%) ⬆️

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 826447b...6025d10. Read the comment docs.

@sczyh30 sczyh30 added area/integrations Issues or PRs related to integrations with open-source components to-review To review labels Oct 17, 2019
@sczyh30 sczyh30 removed the to-review To review label Nov 27, 2019
@sczyh30

sczyh30 commented Nov 27, 2019

Copy link
Copy Markdown
Member

Already resolved in #1104, thanks for your contribution!

@sczyh30 sczyh30 closed this Nov 27, 2019
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can Spring MVC adapters be provided?

3 participants