cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6865) Add cache for target resouce method matching
Date Thu, 14 Apr 2016 13:09:25 GMT

    [ https://issues.apache.org/jira/browse/CXF-6865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241117#comment-15241117
] 

Sergey Beryozkin commented on CXF-6865:
---------------------------------------

I support this issue but it is unlikely that the patch will go to 3.1.7, we need to be careful
and make sure the MBR/MBW cache is stable in 3.1.7. Though indeed both caches can make it
to 3.2.0. This cache will be the most sensitive one so it will need to be enabled on per-production
basis for a start via the configuration property 

> Add cache for target resouce method matching
> --------------------------------------------
>
>                 Key: CXF-6865
>                 URL: https://issues.apache.org/jira/browse/CXF-6865
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 3.1.6, 3.0.9
>         Environment: mac, windows
>            Reporter: Neal Hu
>             Fix For: 3.0.10, 3.1.7, 3.2.0
>
>
> Find the target resouce method in JAXRSInInterceptor is time comsuming:
> JAXRSInInterceptor.java:159==>JAXRSUtils.selectResourceClass(resources, rawPath, message);
> Adding cache for the ori, matchedvalues and mediatype will improve the performence.
> The bottleneck of the CXF implementation is recursiive searching the target root resouce
classes.
> {code:java}
> String ckey = message.get(Message.BASE_PATH) + ":" + rawPath + ":" + httpMethod + ":"
+ requestContentType + ":" + acceptTypes;
>         if (resourceMethodCache != null) {
>             ResourceMethodCache rmCache = resourceMethodCache.get(ckey);
>             if (rmCache != null) {
>                 ori = rmCache.getOperationResourceInfo();
>                 matchedValues = rmCache.getValues();
>                 String mediaType = rmCache.getMediaType();
>                 if (!ori.isSubResourceLocator() && mediaType != null) {
>                     message.getExchange().put(Message.CONTENT_TYPE, mediaType);
>                 }
>                 setExchangeProperties(message, exchange, ori, matchedValues, resources.size());
>                 shouldFind = false;
>             }
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message