When using the ESB profile of WSO2 Enterprise Integrator (WSO2 EI), there can be scenarios where you need to configure WSO2 EI the ESB to route messages through a proxy server. For example, if WSO2 EI the ESB is behind a firewall, your proxy service might need to talk to a server through a proxy server as illustrated in the following diagram:
...
For such scenarios, you need to configure the WSO2 EI the ESB transport sender to forward messages through a proxy server.
...
Table of Contents |
---|
Routing messages through a proxy server
See the instructions given below.
For non-blocking service calls
To configure WSO2 EI the ESB profile to route messages through a proxy server :
...
(for non-blocking service calls), add the parameters given below to the axis2.xml
file (stored in the <EI_HOME>/conf/axis2/
...
http.proxyHost
- The host name of the proxy server.http.proxyPort
- The port number of the proxy server.
Following is a sample <transportSender>
configuration where the parameters mentioned above are set:
...
directory) and update the values. This configuration ensures that all HTTP requests pass through the configured proxy server.
Code Block |
---|
<transportSender name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpSender"> <parameter name="non-blocking" locked="false">true</parameter> <parameter name="http.proxyHost" locked="false">localhost<></parameter> <parameter name="http.proxyPort" locked="false">8080<></parameter> </transportSender> |
When you configure the <transportSender>
with the http.proxyHost
and http.proxyPort
parameters , all HTTP requests pass through the configured proxy server.
The parameters are described below.
non-blocking | Specifies whether or not 'non-blocking' mode is enabled for the transport sender. Be sure that this parameter is set to true . |
---|---|
http.proxyHost | The host name of the proxy server. |
http.proxyPort | The port (number) in the proxy server. |
For blocking service calls
To configure the ESB profile to route messages through a proxy server (for blocking service calls), add the parameters given below to the axis2_blocking_client.xml
file (stored in the <EI_HOME>/conf/axis2/
directory) and update the values. This configuration ensures that all HTTP requests pass through the configured proxy server.
Code Block | ||
---|---|---|
| ||
<parameter name="Proxy">
<parameters>
<ProxyHost></ProxyHost>
<ProxyPort></ProxyPort>
<ProxyUser></ProxyUser>
<ProxyPassword></ProxyPassword>
</parameters>
</parameter> |
The parameters are described below.
ProxyHost | The host name of the proxy server. |
---|---|
ProxyPort | The port (number) in the proxy server. |
ProxyUser | The user name for connecting to the proxy server. |
ProxyPassword | The password for connecting to the proxy server. |
Info | ||||
---|---|---|---|---|
| ||||
In the case of blocking service calls, you can apply a system property in the ESB profile to bypass the proxy server and route messages directly to the hosts that should receive the messages. Explained below are two methods of applying the system property:
|
Info |
---|
A proxy server might require HTTP basic authentication before it handles communication from WSO2 EIthe ESB profile. |
Configuring proxy profiles in
...
the ESB profile
When using WSO2 EIthe ESB profile, there can be scenarios where you need to configure multiple proxy servers to route messages to different endpoints as illustrated in the following diagram.
...
To configure proxy profiles in WSO2 EIthe ESB profile:
Edit the
<EI_HOME>/conf/axis2/axis2.xml
file, add the theproxyProfiles
parameter parameter in the<transportSender>
configuration of the http transport, and then define multiple profiles based on the number of proxy servers you need to have.Info When you define a profile, it is mandatory to specify the
targetHosts
,proxyHost
andproxyPort
parameters for each profile.
...
When you configure a proxy profile, following are details of the parameters that you need to define in a a <profile>
:
Parameter | Description | Required |
---|---|---|
targetHosts | A host name or a comma-separated list of host names for a target endpoint. | Yes |
proxyHost | The host name of the proxy server. | Yes |
proxyPort | The port number of the proxy server. | Yes |
proxyUserName | The user name for the |
proxy server authentication. | No |
proxyPassword | The |
password for the |
proxy server authentication. | No | |
bypass | A host name or a comma-separated list of host names that should not be sent via the proxy server. For example, if you want all requests to You can specify host names as regular expressions that match a pattern. | No |