The |
||||||||||||||||||||||||||||||||
| Element | Description |
|---|---|
httpn:tlsServerParameters | Specifies a set of properties for configuring the security used for the specific Netty instance. See the TLS Configuration page for more information. |
httpn:tlsServerParametersRef | Refers to a set of security properties defined by a |
httpn:threadingParameters | Specifies the size of the thread pool used by the specific Netty instance. |
httpn:threadingParametersRef | Refers to a set of properties defined by a |
httpn:sessionSupport | If the value is true , the Netty Engine will set up a session manager for the Netty server engine to maintain the sessions. The default value of it is false. |
httpn:reuseAddress | The the value is true, the Netty Engine connector's socket will enable the SO_REUSEADDR flage. The default value of it is true. |
You can configure the size of a Netty instance's thread pool by either:
identifiedThreadingParameters element in the engine-factory element. You then refer to the element using a threadingParametersRef element.Specify the size of the of thread pool directly using a threadingParameters element.
The threadingParameters has one attribute to specify the size of a thread pool. The attribute is described below.
The httpn:identifiedThreadingParameters element has a single child threadingParameters element
| Attribute | Description |
|---|---|
threadPoolSize | Specifies the number of threads available to the Netty instance for processing requests. |
If HttpServerEngineSupport#ENABLE_HTTP2 bus property is set, Netty engine will enable the HTTP/2 support as well: HTTP/2 over cleartext (h2c) if TLS is not configured, regular HTTP/2 otherwise. It requires additional dependencies to be bundled by the application.
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>${netty.version}</version>
</dependency>
Please be aware that if you configure HTTP/2 + TLS, CXF right now only supports JDK SSL provider.
The example below shows a configuration fragment that configures a Netty instance on port number 9001.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:httpn="http://cxf.apache.org/transports/http-netty-server/configuration"
xsi:schemaLocation="http://cxf.apache.org/configuration/security
http://cxf.apache.org/schemas/configuration/security.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/transports/http-netty-server/configuration
http://cxf.apache.org/schemas/configuration/http-netty-server.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<httpn:engine-factory bus="cxf">
<httpn:engine port="9001">
<httpn:tlsServerParameters>
<sec:keyManagers keyPassword="skpass">
<sec:keyStore file="src/main/config/serviceKeystore.jks" password="sspass" type="JKS"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore file="src/main/config/serviceKeystore.jks" password="sspass" type="JKS"/>
</sec:trustManagers>
</httpn:tlsServerParameters>
</httpn:engine>
</httpn:engine-factory>
</beans>