Use the wsp.xml configuration file to configure the
ESP WebSocket Provider.
Prerequisites
Install Java Development Kit (JDK) version 1.7.x or 1.8.x. If using version 1.7.x, the
TLSv1.2 protocol is not enabled by default. Set the protocol to TLSv1.2 in the Java 7 code.
For
example:
SslContextFactory sslContextFactory = new SslContextFactory();
//other SSL settings
//…
sslContextFactory.setProtocol("TLSv1.2");
try {
sslContextFactory.start();
} catch (Exception e) {
}
If using Java 1.8.x, the TLSv1.2 protocol is enabled by default.
Context
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.
Procedure
- Enable the ESP Web Services Providers by setting
<webService enabled ="true">.
- In the <protocol> property, set the protocol for the
WebSocket client to which you are connecting the ESP
WebSocket Provider.
- Enable the ESP WebSocket Provider by setting
<webSocket enabled="true">.
- Set properties for the WebSocket Provider within the
<webSocket> section:
Property |
Description |
<webSocketPort> |
(Required) Specify the port of the WebSocket provider.
|
<secured> |
(Required) Specify whether to use HTTP or HTTPS as the protocol. If
set to true, the protocol is HTTPS.
|
<publishSocketLoading> |
(Required) Specify the maximum number of remote connections that
can publish data over a single connection to
ESP.
|
<subscribeSocketLoading> |
(Required) Specify the maximum number of remote connections that
can subscribe to data over a single connection from
ESP.
|
- (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.
Note You cannot use a WebSocket request with a fully-specified URI to publish or
subscribe to a different cluster than the one specified in the
<DefaultCluster> section.
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.
|
- 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.
- (Optional) To edit advanced publisher options for the WebSocket Provider, set the
enabled attribute to true in the
<publishOptions> section. For example,
<publishOptions enabled="true">.
Property |
Description |
<publishBlockMode> |
(Required if the enabled attribute is set to true)
When publishing is buffered, use this property to specify the
publishing block mode. Valid values are none, explicit, and auto.
Explicit lets you control the batches by using start transaction
and end block calls, and auto ignores these calls and batches rows
internally. The default mode is auto (autoblocking).
|
<publishBuffersize> |
(Required if the enabled attribute is set to true)
Specify a positive number to enable buffered publishing. When
publishing is buffered, the data is first written to an internal
queue. This is picked up by a publishing thread and then written to
theESP project. This is the
default operating mode.
|
<publishBlockSize> |
(Required if the enabled attribute is set to true)
This value is only used if the value of
<publishBlockMode> is set to explit.
Specifies the number of rows inside a message block. Recommended
values are 64 to 1024.
|
<publishUseTransactions> |
(Required if the enabled attribute is set to true)
If set to true, the WebSocket Provider uses transaction blocks
instead of envelopes. The default value is false.
|
- (Optional) To edit advanced subscriber options for the WebSocket Provider, set the
enabled attribute to true in the
<subscribeOptions> section. For example,
<subscribeOptions enabled="true">.
Property |
Description |
<baseDrainTimeout> |
(Required if the enabled attribute is set to true)
Specify how long, in milliseconds,
ESP waits for a subscriber to
read all base data. If there are multiple client connections
sharing a subscription to ESP, all
connections are dropped if the web service client is slow.
|
<droppable> |
(Required if the enabled attribute is set to true)
Specify whether ESP should drop a
subscriber that is reading data slowly. If there are multiple
client connections sharing a subscription to
ESP, all connections are dropped
if the web service client is slow
|
<queueSize> |
(Required if the enabled attribute is set to true)
Specify the internal subscription queue size (number of rows) for
ESP to create. Larger values
result in more rows being buffered internally. Note that though
this can help with slower clients, it also increases memory
requirements.
|
- If you are using HTTPS protocol, specify the keystore type, file, and password in
the <Security> section. If you are using HTTP protocol, this
section is ignored.
- (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
WebSocket 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.