问题描述
我有一个CXF Web服务,该服务处理包含base64字符串的请求。有些请求需要很长时间,超出了我们的要求。我希望处理能够在3秒内完成,但是大多数请求都需要12秒。当我跟踪拦截器的处理过程时,DocLiteralInInterceptor消耗的时间最多。根据文档,此拦截器将检查SOAPAction并绑定消息。我正在使用宙斯盾绑定,并尝试在配置中将schema-validation-enabled设置为false来禁用验证。但是没有任何改善。有什么方法可以优化绑定过程吗?
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?
预先感谢。
推荐答案
通过内存处理而不是基于文件的处理,使时序从12秒减少到200 ms。通过将用于内存中处理的默认CXF属性64 KB重写为1MB,如下所示:
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>
这篇关于优化CXF Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!