问题
I have a CXF web service which processes requests containing base64 strings. Some of the requests take long time which exceeds our requirements. I want the processing to complete by 3 seconds but most requests are taking 12 seconds. When i trace the processing of the interceptors, the DocLiteralInInterceptor is consuming the most time. As per documentation, this interceptor checks the SOAPAction and binds the message. I am using aegis binding and tried to disable the validation with schema-validation-enabled to false in the configuration. But there is no improvement. Is there any way to optimize the binding process?
Thanks in advance.
回答1:
Managed to get the timing reduced from 12 sec to 200 ms by in-memory processing instead of file based processing. This was done by overriding the default CXF property of 64 KB for in-memory processing to 1MB as below:
<cxf:properties>
<entry key="bus.io.CachedOutputStream.Threshold" value="1000000"/>
<entry key="bus.io.CachedOutputStream.MaxSize" value="1000000000"/>
</cxf:properties>
来源:https://stackoverflow.com/questions/52287431/optimizing-cxf-webservice