Changing the Default Transport
On the back end, APIs are Apache Synapse configurations that WSO2 API Manager accesses through a transport. The default API Manager transport is the PassThrough transport, but you can configure a different default transport in your axis2.xml
file. For example, to use the HTTP-NIO transport as the default, go to the <APIM_HOME>/repository/conf/axis2
folder, open the axis2.xml
file, and then in the "Transport Ins" and "Transport Outs" sections, comment out the PassThrough configurations and uncomment the configurations for the HTTP-NIO transport.
WSO2 products do not use the HTTP/S servlet transport configurations that are in axis2.xml
file. Instead, they use Tomcat-level servlet transports, which are used by the management console in <PRODUCT_HOME>/repository/conf/tomcat/catalina-server.xml
 file.
The following topics provide more information on these transports:
HTTP PassThrough transport
HTTP PassThrough Transport is the default, non-blocking HTTP transport implementation based on HTTP Core NIO and is specially designed for streaming messages. It is similar to the old message relay transport, but it does not care about the content type and simply streams all received messages through. It also has a simpler and cleaner model for forwarding messages back and forth. The two classes that implement the receiver and sender APIs are org.apache.synapse.transport.passthru.PassThroughHttpListener
and org.apache.synapse.transport.passthru.PassThroughHttpSender
, respectively. The PassThrough Transport does not require the binary relay builder and expanding formatter.
HTTP-NIO transport
The HTTP-NIO transport is a module of the Apache Synapse project. Apache Synapse ships the HTTP-NIO transport as the default, non-blocking HTTP transport implementation. The two classes that implement the receiver and sender APIs are org.apache.synapse.transport.nhttp.HttpCoreNIOListener
and org.apache.synapse.transport.nhttp.HttpCoreNIOSender
, respectively. These classes are available in the JAR file named synapse-nhttp-transport.jar
. The transport implementation is based on Apache HTTP Core - NIO and uses a configurable pool of non-blocking worker threads to grab incoming HTTP messages off the wire. The PassThrough transport is the preferred default transport for WSO2 API Manager, but HTTP-NIO is supported for backward compatibility.
Transport receiver parameters
Parameter Name | Description | Required | Possible Values | Default Value |
---|---|---|---|---|
port | The port on which this transport receiver should listen for incoming messages. | No | A positive integer less than 65535 | 8280 |
non-blocking | Setting this parameter to true is vital for reliable messaging and a number of other scenarios to work properly. | Yes |
|
|
bind-address | The address of the interface to which the transport listener should bind. | No | A host name or an IP address | 127.0.0.1 |
WSDLEPRPrefix | A URL prefix which will be added to all service EPRs and EPRs in WSDLs etc. | No | A URL of the form <protocol>://<hostname>:<port>/ | |
httpGetProcessor | An extension point used to execute a special interceptor for HTTP GET requests. | Yes | An extension point |
|
priorityConfigFile | The location of the file containing the configuration for priority based dispatching. | No | A file location |
Transport sender parameters
Parameter Name | Description | Required | Possible Values | Default Value |
---|---|---|---|---|
non-blocking | Setting this parameter to true is vital for reliable messaging and a number of other scenarios to work properly. | Yes | true or false | true |
warnOnHTTP500 | Logs warnings for HTTP 500 responses only for the specified content-types. For example,
| No | A list of content types separated by "|" | |
http.proxyHost | If the outgoing messages should be sent through an HTTP proxy server, use this parameter to specify the target proxy. | No | A host name or an IP address | |
http.proxyPort | The port through which the target proxy accepts HTTP traffic. | No | A positive integer less than 65535 | |
http.nonProxyHosts | The list of hosts to which the HTTP traffic should be sent directly without going through the proxy. When trying to add multiple hostnames along with an asterisk in order to define a set of sub-domains for non-proxy hosts, you need to add a period before the asterisk when configuring proxy server.
| No | A list of host names or IP addresses separated by '|' |
Connection throttling
With the HTTP PassThrough and HTTP NIO transports, you can enable connection throttling to restrict the number of simultaneous open connections. To enable connection throttling, edit the <PRODUCT_HOME>/repository/conf/nhttp.properties
(for the HTTP NIO transport) or <PRODUCT_HOME>/repository/conf/passthru.properties
(for the PassThrough transport) and add the following line: max_open_connections = 2
This will restrict simultaneous open incoming connections to 2. To disable throttling, delete the max_open_connections
setting or set it to -1.
Connection throttling is never exact. For example, setting this property to 2 will result in roughly two simultaneous open connections at any given time.