Use the wsp.xml configuration file to configure the
ESP REST Provider.
Prerequisites
In order to use SSL on the ESP, install Java Development Kit
(JDK) version 8 or higher.
Procedure
- In the %STREAMING_HOME%\wsp\wsp.xml or
$STREAMING_HOME/wsp/wsp.xml
file:
Note When performing a custom installation of ESP,
the installer sets cluster parameters in wsp.xml to the values provided during
setup.
- Enable the ESP Web Services Providers by
setting <webService enabled ="true">.
- Set the protocol and port number for the REST provider to which you are
connecting the ESP REST Provider.
- (Optional) Set a maximum allowable size, in bytes, for a REST request. This
value should be a positive integer.
If you specify a negative number, the Jetty default value of 200,000 bytes
is used. Any invalid values result in an integer parsing exception.
- Set cacheSize to the number of publishing transactions to
make before committing.
- (Optional) Edit the URL in the <allowOrigin> property
from the default value of http://localhost.
This property is set by default to stop the resource from being shared with
other requesters from other origins. This restricts the response header of
Access-Control--Allow-Origin for REST APIs. Specifying a value of * allows all
origins.Only one URL can be specified, a list is not permitted.
- (Optional) Edit the cluster information in the
<DefaultCluster> section to avoid having to specify full
connection details for the cluster each time you send a request. If you do not edit this
section, the information for the cluster you created during the installation process is
specified by default.
If you do not edit this section, the information for the cluster you created
during the installation process is specified by default.
Property |
Description |
<Hostname> |
(Required) Specify the name of the host on which the cluster resides.
|
<Port> |
(Required) Specify the cluster's port number.
|
<Workspace> |
(Required) Specify the workspace associated with the cluster. The
default value is default.
|
<Authtype> |
(Required) Specify the authentication type.Valid values are user, rsa, and kerberos.
|
<SslEnabled> |
(Required) Specify whether SSL is enabled. Valid values are true or
false.
|
<projectLoading> |
(Required) Specify the maximum number of socket connections (either
publish or subscribe) to ESP to
create for each project instance.
|
- If you are using HTTPS, specify the keystore type, file, and password in the
<Security> section. If you are using HTTP, this
section is ignored.
- Edit the thread pool configuration that Jetty uses by editing the values in the
<threadPool> section:
- In the <minThreads> parameter, specify the minimum
number of threads you want Jetty to spawn. The default value is 20.
- In the <maxThreads> parameter, specify the maximum
number of threads that Jetty may spawn to service incoming connections. The
default value is 500.
- In the <idleTimeout> parameter, specify the amount of
time, in milliseconds, that a threads needs to idle before becoming eligible
to be stopped. The default value is 30000.
- (If Kerberos authentication is enabled on the ESP Server) In
the %STREAMING_HOME%\wsp\wsp.bat or
$STREAMING_HOME/wsp/wsp.sh script,
add:
-Djava.security.krb5.realm=<RealmName> -Djava.security.krb5.kdc=<ServerName>
Next Steps
- Ensure that the STREAMING_HOME environment variable is set. If it is
not, set it to
<Install_Dir>ESP-5_1.
- Use the wsp.bat or wsp.sh script in
%STREAMING_HOME%\wsp to start the
Jetty server (which initializes both SOAP and REST ports).
- To expose a project as a Web service using the ESP
REST Provider, set the Web Service Enabled option in the project configuration (.ccr)
file to true and stop and remove the project from the node, then redeploy (add) the
project. You can also restart the cluster server instead of redeploying the
project.