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

Sergey Beryozkin commented on CXF-6837:
---------------------------------------

I'm still not convinced that we need to key first on Class and next on 
MediaType, what I'm saying is that it should be a key, say "ProviderKey" bean 
with Class and MediaType properties, this will immediately simplify your 
Provider cache code.
But as I said, Type and Annotation (the other 2 parameters passed to 
isReadable/isWriteable), as in 

https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/ext/MessageBodyReader.html#isReadable(java.lang.Class,%20java.lang.reflect.Type,%20java.lang.annotation.Annotation[],%20javax.ws.rs.core.MediaType)

should also be in ProviderKey, example, you can have List of A and List of B 
providers. Some providers will also reject isReadable/isWriteable based on the 
annotations attached to a given method or its parameter.

So I recommend you to have a single map first, i.e, simplify the code, and then 
continue debugging.

Suppose you have JAXRSClientServerBook or some other test failing. Check at the 
top of this/other test the code which creates the server, example, 
BookStoreServer in this case, etc. Some servers like BookStoreServer create the 
endpoint directly, others - they load the Spring context (in 
test/resources/jaxrs, etc, you will the name of the context in server code),  
and you can find the name of the actual server in the context bean.
Then before debugging a test - add a line like to a given test, 
"WebClient.getConfig(webClient).getHttpConduit().getClient().setReceiveTimeout(100000000)"
 to avoid socket timeout issues...



> Add cache for MessageBodyReader/Writer
> --------------------------------------
>
>                 Key: CXF-6837
>                 URL: https://issues.apache.org/jira/browse/CXF-6837
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 3.1.5, 3.0.8
>         Environment: windows
>            Reporter: Neal Hu
>             Fix For: 3.2.0
>
>         Attachments: ProviderCache.java, ProviderFactory.patch
>
>
> CXF selects the msgBodyReader/writer in the reader/writer list for every 
> request, which has big impact to the performance. Jersey also has the cache 
> in 
> org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(...).
>  I have tried add the cache for CXF in ProviderFactory and been proved that 
> it has improved 7-8% for json requests in JMeter. Please let me know if you'd 
> like me to add the enhancement for CXF. Thanks. 
> http://cxf.547215.n5.nabble.com/MessageBodyReader-Writer-cache-td5767091.html



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

Reply via email to