Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Connection pooling in Apache CXF

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?

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?

like image 281
RaceBase Avatar asked Apr 29 '15 10:04

RaceBase


1 Answers

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 (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.

  2. 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.

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

Hope it helps.

like image 131
Tarun Tyagi Avatar answered Oct 27 '22 03:10

Tarun Tyagi