在tomee中设置cxf rest client的超时时间

时间:2017-10-20 21:40:05

标签: java-ee cxf tomee tomee-7

我希望在应用程序级别为Tomee中的所有jax-rs请求设置ReceiveTimeout属性。我无法找到任何特定于设置属性的文档,而不是代码中的低级别:

client.property("http.receive.timeout", "1000");

为了设置拦截器,Tomee文档建议:

  1. set openejb-jar
  2. 设置resources.xml
  3. 如下。

    知道如何实现客户端属性的设置吗?

    <?xml version="1.0" encoding="UTF-8"?>
    <openejb-jar>
     <pojo-deployment class-name="jaxrs-application">
       <properties>
         # optional but requires to skip scanned providers if set to true
         cxf.jaxrs.skip-provider-scanning = true
         # list of providers we want
         cxf.jaxrs.providers = johnzon,org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper
       </properties>
     </pojo-deployment>
    </openejb-jar>
    
    <?xml version="1.0" encoding="UTF-8"?>
    <resources>
     <Service id="johnzon" class-name="org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider">
       # 1M
       maxSize = 1048576
       bufferSize = 1048576
    
       # ordered attributes
       attributeOrder = $order
    
       # Additional types to ignore
       ignores = org.apache.cxf.jaxrs.ext.multipart.MultipartBody
     </Service>
    
     <Service id="order" class-name="com.company.MyAttributeSorter" />
    
    </resources>
    

0 个答案:

没有答案