我希望在应用程序级别为 Tomee 中的所有 jax-rs 请求设置 ReceiveTimeout 属性。除了代码中的低级别之外,我找不到任何特定于设置属性的文档:
client.property("http.receive.timeout", "1000");
对于设置拦截器,Tomee 文档建议:
- 设置 openejb-jar
- 设置资源.xml
如下。
知道如何实现客户端属性的设置吗?
<?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>