Apache CXF中的HTTP连接池 [英] HTTP Connection pooling in Apache CXF

查看:427
本文介绍了Apache CXF中的HTTP连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检查Apache CXF是否实现 HTTP连接池?如果是,我们如何配置相同。如果没有,我们怎样才能实现同样目标?

I am trying to check whether Apache CXF implements HTTP Connection Pooling? If yes, how can we configure the same. If not, how can we achieve the same?

这个主题朝着同样的方向发展。但目前尚不清楚 HTTPConduit 是否有办法设置相同或正确配置。

This thread is little direction towards the same. But it's not clear whether HTTPConduit has a way to set the same or properly configure.

任何人都可以指导我这个?

Can anyone guide me on this?

推荐答案

Apache CXF在内部使用HTTPUrlConnection并依赖于java系统属性来配置客户端连接设置。

Apache CXF uses HTTPUrlConnection internally and relies on java system properties to configure client connection settings.

您可以配置的两个主要内容如下:

Two main ones that you can configure are as follows:


  1. http.keepAlive(默认值) :true) -
    指示是否应支持持久连接。它们通过允许底层套接字连接重用于多个http请求来提高性能。如果将此设置为true,则将使用HTTP 1.1服务器请求持久连接。

  1. http.keepAlive (default: true) - Indicates if persistent connections should be supported. They improve performance by allowing the underlying socket connection to be reused for multiple http requests. If this is set to true then persistent connections will be requested with HTTP 1.1 servers.

http.maxConnections(默认值:5) -
如果HTTP keepalive已启用(参见上文)此值确定每个目标将同时保持活动状态的最大空闲连接数。

http.maxConnections (default: 5) - If HTTP keepalive is enabled (see above) this value determines the maximum number of idle connections that will be simultaneously kept alive, per destination.

此处是您可以设置为配置HTTPUrlConnection的所有属性的列表

Here is a list of all the properties that you can set to configure HTTPUrlConnection

希望它有所帮助。

这篇关于Apache CXF中的HTTP连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆