Configuring the Web Socket transport

The Web Socket transport allows the probe to connect to the target device to send the following types of HTTP requests:

  • loginRequest: This is sent after the OAuth access token request to log into the target system.
  • loginRefresh This is sent periodically to refresh the login on the target device.
  • logoutRequest This is sent before disconnecting from the target device.
  • resynchRequest This is sent to request an event resynchronization with the target device.
  • subscribeRequest This is sent to subscribe to received events from the target device as they are created.
  • subscribeRefresh This is sent periodically to refresh the event subscription on the target device.

Web Socket transport properties

The following table describes the properties in the restWebSocketTransport.properties file. The restWebSocketTransport.properties file controls the integration with the Message Bus Probe using Web Socket.

Note: When using the WebSocket transport, you must specify values for the Host and Port properties in the message_bus.props file.
Table 1. Properties in the restWebSocketTransport.properties file

Property name

Description

httpVersion

Use this property to specify the version of the HTTP protocol that the target system supports.

The default is 1.1.

httpHeaders

Use this property to specify the HTTP header options to use in all HTTP requests. This property accepts a comma separated list of key-value pairs using the equals sign (=) as the value separator.

For options that accept multiple values, use the double-quote (") character around the value and a use semi-colon (;) as the value separator; for example: Keep-alive="timeout 30;max 10",Connection=Keep-alive

For the authorization header option, the credentials that follow the single whitespace after Basic are encoded as a Base-64 encoded string. For example, to authenticate with the username Me, and the password MyPassword, set the httpHeader property to Authorization=Basic Me:MyPassword. The probe passes this as an authorization header with every request.

The default value is "".

Note: The httpHeaders property sets the headers for all HTTP requests. However, you can override these global HTTP header options using the following properties:
  • loginRequestHeaders
  • loginRefreshHeaders
  • logoutRequestHeaders
  • resyncRequestHeaders
  • subscribeRequestHeaders
  • subscribeRefreshHeaders

responseTimeout

Use this property to specify how long (in seconds) the probe waits for a response from the target system before timing out.

The default is 60 seconds.

loginRequestURI

Use this property to specify the URI that the probe uses to request a login.

loginRequestMethod

Use this property to specify the message type that the probe sends to request a login.

loginRequestContent

Use this property to specify any additional information that the probe sends with the login request.

loginRequestHeaders

Use this property to specify an HTTP header to send with all login requests. This overrides the global HTTP header options configured by the httpHeader property.

loginRefreshURI

Use this property to specify the URI that the probe uses to refresh the login on the target device.

loginRefreshMethod

Use this property to specify the message type that the probe sends to refresh the login on the target device.

loginRefreshContent

Use this property to specify any additional information that the probe sends with the login refresh request.

loginRefreshHeaders

Use this property to specify an HTTP header to send with all login refresh requests. This overrides the global HTTP header options configured by the httpHeader property.

loginRefreshInterval

Use this property to specify the interval (in seconds) that the probe leaves between successive login refresh requests.

This can be disabled by setting it to "" or leaving it commented out. If set to a negative value or an valid value such as String, it will default to 60 seconds.

logoutRequestURI

Use this property to specify the URI that the probe uses to request a logout from the target device.

logoutRequestMethod

Use this property to specify the message type that the probe sends to request a logout from the target device.

logoutRequestContent

Use this property to specify any additional information that the probe sends with the logout request.

logoutRequestHeaders

Use this property to specify an HTTP header to send with all logout requests. This overrides the global HTTP header options configured by the httpHeader property.

resyncRequestURI

Use this property to specify the URI that the probe uses to request a resynchronization with the target system at startup. You can append the URI that you specify with this property with a query filter that limits the scope of the events that are returned by the request.

Note: resyncRequestURI and resyncRequestMethod=GET can be used independently, together with httpversion and responsetimeout, to perform the resynchornization. However, either initialResync or resyncinterval must also be specified.

resyncRequestMethod

Use this property to specify the message type that the probe sends to request a resynchronization with the target system.

Note: resyncRequestURI and resyncRequestMethod=GET can be used independently, together with httpversion and responsetimeout, to perform the resynchornization. However, either initialResync or resyncinterval must also be specified.

resyncRequestContent

Use this property to specify any additional information that the probe sends with the resynchronization request.

resyncRequestHeaders

Use this property to specify an HTTP header to send with all resynchronization requests. This overrides the global HTTP header options configured by the httpHeader property.

subscribeRequestURI

Use this property to specify the URI that the probe uses to request a subscription to receive new alarms as they are created in the target system.

subscribeRequestMethod

Use this property to specify the message type that the probe sends to request a subscription to receive new alarms.

subscribeRequestContent

Use this property to specify any additional information that the probe sends with the subscription request.

subscribeRequestHeaders

Use this property to specify an HTTP header to send with all subscription requests. This overrides the global HTTP header options configured by the httpHeader property.

subscribeRefreshURI

Use this property to specify the URI that the probe uses to request a subscription refresh.

subscribeRefreshMethod

Use this property to specify the message type that the probe sends to request a subscription refresh.

subscribeRefreshContent

Use this property to specify any additional information that the probe sends with the subscription refresh request.

subscribeRefreshHeaders

Use this property to specify an HTTP header to send with all subscription refresh requests. This overrides the global HTTP header options configured by the httpHeader property.

subscribeRefreshInterval

Use this property to specify the interval (in seconds) that the probe leaves between successive subscription refresh requests.

This can be disabled by setting it to "" or leaving it commented out. If it is set to a negative value or an valid value such as String, it will default to 60 seconds.

keepTokens

Use this property to specify a comma-separated list of the attributes that the probe extracts from the incoming JSON data. These data items can be used in token substitution throughout the runtime of the probe.

webSocketHeaders

Use this property to specify a comma-separated list of HTTP headers to send with the initial Websocket handshake request. This overrides the global HTTP header options configured by the httpHeader property.

Example use: By setting "webSocketHeaders=Authorization=Bearer ++token++", the Authorization Header will be included in the handshake to provide a Bearer token for authentication. The "++token++" will be substituted with a value retrieved from prior requests such as login or resync requests. This must be used with the keepTokens property, for example: "keepTokens=token" so that the value of the "token" attribute received from the HTTP response is kept in memory.

webSocketURI

Use this property to specify the URI that the probe uses to request a WebSocket connection with the REST API.

Note: webSocketURI can work independently allowing the probe to subscribe to the target system.

webSocketPeristentURI

Use this property to specify the persistent URI that the probe uses to re-establish a WebSocket connection.

Note: This property takes precedence over webSocketURI if both are set. But, the probe uses webSocketURI if webSocketPeristentURI contains tokens that can not be resolved to construct the final URI to use to establish the WebSocket connection.

webSocketSubProtocol

Use this property to specify the WebSocket subprotocol to use.

webSocketSubscribeMessage

Use this property to specify the subscribe message that the probe sends to the server through the WebSocket channel after successfully establishing the connection.

webSocketRefreshMessage

Use this property to specify the refresh message to send in the Ping frame that the probe sends to the WebSocket.

webSocketRefreshInterval

Use this property to specify the interval (in seconds) that the probe leaves between sending successive refresh requests to the WebSocket.

This can be disabled by setting it to "" or leaving it commented out. If it is set to a negative value or an valid value such as String, it will default to 60 seconds.

webSocketMaxFramePayloadLength

Use this property to configure the size in bytes of the payload frame of the WebSocket. Specify a value between 1 and 512000 bytes (512KB). The default value is 65536 (bytes).

If the probe receives a websocket frame that is bigger than the value set for this property, the probe fails and writes a message to the error log.

refreshRetryCount

Use this property to specify the maximum number of times that the probes sends a refresh request.

If set to an invalid value such as a string or a value less than zero, it will default to zero and no limit is applied. The default is 0.

securityProtocol

Use this property to specify the security protocol to use when retrieving events from the REST API.

tokenEndpointURI

Use this property to specify the URI that the probe uses to obtain an access token for the target device.

This is the path on the remote host to request an access token, for example:

tokenEndpointURI=/oauth/token

By default, this property is not set, which disables the OAuth token request; no access token request will be sent to the server.

basicAuthenticationUsername

Use this property to specify the basic authentication username that the probe should use in the authentication header to gain access to the target device.

basicAuthenticationPassword

Use this property to specify the password associated with the basic authentication username that the probe should use in the authentication header.

clientId

Use this property to specify the Client ID registered with the Oauth server. This parameter will be sent in the HTTP request-body. Leave this property empty if this should be omitted to use the Basic Authentication client authentication method.

clientSecret

Use this property to specify the Client Secret string registered to the clientId. This parameter will be sent in the HTTP request-body. Leave this property empty if this should be omitted to use the Basic Authentication client authentication method.

scope

Use this property to specify the level of access to the target server that the probe is requesting.

You can specify a comma-separated list of scopes, for example:

scope=read,write

The following is an example of a restWebSocketTransport.properties file:
# Example format of Web Socket properties file
#httpVersion=1.1
#httpHeaders=
#responseTimeout=60
#loginRequestURI=
#loginRequestMethod=
#loginRequestContent
#loginRequestHeaders=
#loginRefreshURI=
#loginRefreshMethod=
#loginRefreshContent=
#loginRefreshHeaders=
#loginRefreshInterval=
#logoutRequestURI=
#logoutRequestMethod=
#logoutRequestContent=
#logoutRequestHeaders=
#resyncRequestURI=
#resyncRequestMethod=
#resyncRequestContent=
#resyncRequestHeaders=
#subscribeRequestURI=
#subscribeRequestMethod=
#subscribeRequestContent=
#subscribeRequestHeaders=
#subscribeRefreshURI=
#subscribeRefreshMethod=
#subscribeRefreshContent=
#subscribeRefreshHeaders=
#subscribeRefreshInterval=
#keepTokens=
#webSocketURI=
#webSocketPersistentURI=
#webSocketSubProtocol=
#webSocketSubscribeMessage=
#webSocketRefreshMessage=
#webSocketRefreshInterval=
#webSocketMaxFramePayloadLength=65536
#refreshRetryCount=0
#securityProtocol=
#tokenEndpointURI=
#basicAuthenticationUsername=
#basicAuthenticationPassword=
#clientId=
#clientSecret=
#scope=