Contents
class solace.SessionProperties extends APIProperties
Represents a session properties object. Passed in to solace.SolclientFactory.createSession when creating a solace.Session instance.
Constructor Top
SessionProperties ( Object options ) |
Constants Top
const String | DEFAULT_CIPHER_SUITES |
Properties Top
Methods Top
String | toString ( ) |
Constructor details
Top
SessionProperties
( Object options )
Represents a session properties object. Passed in to
solace.SolclientFactory.createSession when creating a solace.Session instance.
Represents a session properties object. Passed in to solace.SolclientFactory.createSession when creating a solace.Session instance.
Constants Detail Top
static
public
String
DEFAULT_CIPHER_SUITES
The default comma separated list of cipher suites in order of preference used for SSL connections.
Properties Detail Top
public
String
accessToken
= ""
""
The access token required for OAUTH2 authentication.
- This is only relevant if the solace.AuthenticationScheme.OAUTH2 authentication scheme is being used.
public
String
applicationDescription
= ""
""
A string that uniquely describes the application instance.
- If left blank, the API will generate a description string using the current user-agent string.
public
Number
assumedMaxAdSize
= 30000000
30000000
The assumed maximum AD message payload size before the session is established. This value is irrelevant after session connection establishment, because at that point the broker-reported AD size limit takes precedence.
Before the session is connected, messages with payloads larger than this number are rejected upon send(). The default value of 30000000 is appropriate for appliances, whereas for VMRs it should be set to 10000000.
- The valid range is > 0.
The authentication scheme used when establishing the session.
public
String
clientName
= ""
""
The client name that is used during login as a unique identifier for the session on the Solace Message Router.
- An empty string causes a unique client name to be generated automatically.
- If specified, it must be a valid Topic name, and a maximum of 160 bytes in length.
- This property is also used to uniquely identify the sender in a message's senderId field if solace.SessionProperties.includeSenderId is set.
public
Number
compressionLevel
= 0
0
zlib compression level (1-9) or no compression (0)
When this property is set to a valid, non-zero value (1-9):
tcp:// connections are established compressed. This usually requires connecting to a different tcp port on the router, 55003 by default.
tcps:// connections are established uncompressed, but then negotiate compression on login. Compression before encryption allows inference of similarities between messages from observing packet sizes on the network. This could lead to chosen Plaintext attacks. Can be combined with sslDowngradeConnectionTo for no encryption beyond authentication.
ws(s):// and http(s):// transports do not support compression and are considered invalid.
public
Number
connectRetries
= 20
20
The number of times to retry connecting during initial connection setup.
When using a host list, each traversal of the list is considered a try; therefore, if
connectRetries === 2
, the host list will be traversed up to three times: once
for the initial try, and twice more for the retries. Each retry begins with the first host
listed. After each unsuccessful attempt to connect to a host, the API waits for the amount
of time set for solace.SessionProperties#reconnectRetryWaitInMsecs before attempting
another connection. The next connection attempt may be to the same host,
see solace.SessionProperties#connectRetriesPerHost.
If an established connection fails, the reconnection is attempted with solace.SessionProperties#reconnectRetries retries instead.
- The valid range is connectRetries >= -1.
- -1 means try to connect forever.
- 0 means no automatic connection retries; the API will try once and then give up.
- connectRetries >= 1 means reattempt connection n times.
public
Number
connectRetriesPerHost
= 0
0
When using a host list, this property defines how many times to try to connect to a single host before moving to the next host in the list.
- The valid range is connectRetriesPerHost >= -1.
- -1 means attempt an infinite number of connection retries. The API will only attempt to connect to the first host in the list.
- 0 means make a single connection attempt per host, with no retries.
public
Number
connectTimeoutInMsecs
= 8000
8000
The timeout period (in milliseconds) for a connect operation to a given host. If no value is provided, the default is 8000.
- The valid range is > 0.
public
Boolean
generateReceiveTimestamps
= false
false
When enabled, a receive timestamp is recorded for each message and passed to the session's message callback receive handler.
public
Boolean
generateSendTimestamps
= false
false
When enabled, a send timestamp is automatically included (if not already present) in the Solace-defined fields for each message sent.
public
Boolean
generateSequenceNumber
= false
false
When enabled, a sequence number is automatically included (if not already present) in the Solace-defined fields for each message sent.
public
String
idToken
= ""
""
The ID token required for OIDC authentication.
- This is only relevant if the solace.AuthenticationScheme.OAUTH2 authentication scheme is being used.
public
Boolean
ignoreDuplicateSubscriptionError
= true
true
Used to ignore duplicate subscription errors on subscribe.
public
Boolean
ignoreSubscriptionNotFoundError
= true
true
Used to ignore subscription not found errors on unsubscribe.
public
Boolean
includeSenderId
= false
false
When enabled, a sender ID is automatically included (if not already present) in the Solace-defined fields for each message sent.
public
String
issuerIdentifier
= ""
""
The issuer identifier is optional for OAUTH2 authentication.
- This is only relevant if the solace.AuthenticationScheme.OAUTH2 authentication scheme is being used.
public
Number
keepAliveIntervalInMsecs
= 3000
3000
The amount of time (in milliseconds) to wait between sending out keep-alive messages to the Solace Message Router.
- The valid range is > 0.
public
Number
keepAliveIntervalsLimit
= 3
3
The maximum number of consecutive Keep-Alive messages that can be sent without receiving a response before the session is declared down and the connection is closed by the API.
- The valid range is >= 3.
public
Number
maxWebPayload
= 1048576 (1MB)
1048576 (1MB)
The maximum payload size (in bytes) when sending data using the Web transport protocol. Large messages may fail to be sent to the Solace Message Router when the maximum web payload is set to a small value. To avoid this, use a large maximum web payload.
- The valid range is >= 100.
public
Boolean
noLocal
= false
false
Set to 'true' to signal the Solace Message Router that messages published on the session should not be received on the same session even if the client has a subscription that matches the published topic. If this restriction is requested, and the Solace Message Router does not have No Local support, the session connect will fail.
public
readonly String
p2pInboxInUse
= ""
""
A read-only string that indicates the default reply-to destination used for any request messages sent from this session. See solace.Session#sendRequest. This parameter is only valid when the session is connected.
public
String
password
= ""
""
The password required for authentication.
public
Number
payloadCompressionLevel
= 0
0
Valid values for the payload compression level to be applied to the payload of a message published by a client are 0-9.
Value meanings:
- 0 - disable payload compression (the default)
- 1 - lowest CPU impact
- 9 - highest compression
Default: 0
Sets the guaranteed messaging publisher properties for the session. If the supplied value is not a solace.MessagePublisherProperties, one will be constructed using the supplied value as an argument.
public
Number
readTimeoutInMsecs
= 10000
10000
The timeout period (in milliseconds) for a reply to come back from the Solace Message Router. This timeout serves as the default request timeout for solace.Session#subscribe, solace.Session#unsubscribe, solace.Session#updateProperty.
- The valid range is >= 0.
public
Boolean
reapplySubscriptions
= false
false
Set to 'true' to have the API remember subscriptions and reapply them upon calling solace.Session#connect on a disconnected session.
public
Number
reconnectRetries
= 20
20
The number of times to retry connecting after a connected session goes down.
When using a host list, each traversal of the list is considered a try; therefore, if
reconnectRetries === 2
, the host list will be traversed up to three times: once
for the initial try, and twice more for the retries. Each retry begins with the first host
listed. After each unsuccessful attempt to connect to a host, the API waits for the amount
of time set for solace.SessionProperties#reconnectRetryWaitInMsecs before attempting
another connection. The next reconnect attempt may be to the same host,
see solace.SessionProperties#connectRetriesPerHost.
- The valid range is reconnectRetries >= -1.
- -1 means try to reconnect forever.
- 0 means no automatic reconnect retries; the API will try once and then give up.
- reconnectRetries >= 1 means reattempt reconnect n times.
public
Number
reconnectRetryWaitInMsecs
= 3000
3000
How much time to wait (in ms) between each attempt to connect to a host. If a connect attempt is not successful, the API waits for the amount of time specified, and then makes another attempt to connect. solace.SessionProperties#connectRetriesPerHost sets how many connection attempts will be made before moving on to the next host in the list. The valid range is >= 0 and <= 60000.
public
Number
sendBufferMaxSize
= 65536 (64KB)
65536 (64KB)
The maximum buffer size for the transport session. This size must be bigger than the largest message an application intends to send on the session.
The session buffer size configured using the sendBufferMaxSize session property controls SolClient buffering of transmit messages. When sending small messages, the session buffer size should be set to multiple times the typical message size to improve the performance. Regardless of the buffer size, SolClient always accepts at least one message to transmit. So even if a single message exceeds sendBufferMaxSize, it is accepted and transmitted as long as the current buffered data is zero. However, no more messages are accepted until the amount of data buffered is reduced enough to allow room below sendBufferMaxSize.
- The valid range is > 0.
public
String
sslCertificate
= empty string
empty string
The file name of a file containing certificate key of the client in PEM format.
- Only relevant when solace.AuthenticationScheme.CLIENT_CERTIFICATE is used
- Mutually exclusive to sslPfx property
A comma separated list of cipher suites in order of preference used for TLS connections.
- Allowed values:
- AES128-GCM-SHA256
- AES128-SHA
- AES128-SHA256
- AES256-GCM-SHA384
- AES256-SHA
- AES256-SHA256
- DES-CBC3-SHA
- ECDHE-RSA-AES128-GCM-SHA256
- ECDHE-RSA-AES128-SHA
- ECDHE-RSA-AES128-SHA256
- ECDHE-RSA-AES256-GCM-SHA384
- ECDHE-RSA-AES256-SHA
- ECDHE-RSA-AES256-SHA384
- ECDHE-RSA-DES-CBC3-SHA
- RC4-SHA
- RC4-MD5
Disable encryption after authentication
When set to solace.SslDowngrade.PLAINTEXT, all message traffic beyond the initial login is unencrypted. A TLS connection is negotiated on the regular TLS port (55443 by default), TLS authentication schemes can be used, same as without this option. After a successful login however, a TLS shutdown is performed, and the same socket is then used for unencrypted message traffic.
Please note this way plain text traffic passes on a port usually associated with encryption (55443 by default)
This downgrade is only supported for tcps:// connections, all other URL schemes ignore this option.
Can be combined with compressionLevel for non-encrypted, compressed message transfer after login.
public
[ 'Array' ].<String>
sslExcludedProtocols
= null
null
An array of TLS protocols to be excluded when negotiating which protocol to use.
- Allowed values are: TLSv1, TLSv1.1, TLSv1.2
- Note: when a protocol version is excluded without excluding all of its previous protocol versions, the effect is to also exclude all subsequent protocol versions.
public
String
sslPfx
= ""
""
The file name of a file containing private key, certificate and optional CA certificates of the client in PFX or PKCS12 format.
- Only relevant when solace.AuthenticationScheme.CLIENT_CERTIFICATE is used
- Mutually exclusive to sslPrivateKey, sslCertificate and sslTrustStores properties
public
String
sslPfxPassword
= empty string
empty string
A string containing password for the client pfx file.
- Only relevant when solace.AuthenticationScheme.CLIENT_CERTIFICATE is used
public
String
sslPrivateKey
= empty string
empty string
The file name of a file containing private key of the client in PEM format.
- Only relevant when solace.AuthenticationScheme.CLIENT_CERTIFICATE is used
- Mutually exclusive to sslPfx property
public
String
sslPrivateKeyPassword
= empty string
empty string
A string containg password for the client private key.
- Only relevant when solace.AuthenticationScheme.CLIENT_CERTIFICATE is used
public
[ 'Array' ].<String>
sslTrustedCommonNameList
= null
null
An array of acceptable common names for matching with the server certificate. If set to a non-empty array, the API will override the default hostname validation logic provided by Node.js with its own implemenation; if set to empty array, no hostname validation will be performed.
- Only relevant when solace.SessionProperties#sslValidateCertificate is set to true
- Note that leading and trailing whitespaces are considered to be part of the common names and are not ignored
public
[ 'Array' ].<String>
sslTrustStores
= null
null
An array of file names of trusted certificates in PEM format. If not set, and solace.SessionProperties#sslValidateCertificate is set to true, the server certificate will be validated against well known "root" CAs.
- Mutually exclusive to sslPfx property when solace.SessionProperties#sslValidateCertificate is set
public
Boolean
sslValidateCertificate
= true
true
Whether the server certificate shall be verified against the list of certificates in the trust stores. If set to false, all certificate validation is disabled, including date, hostname and common name validation.
public
Number
subscriberLocalPriority
= 1
1
Subscriber priorities are used by the Solace Message Router to distribute messages that have the solace.Message#setDeliverToOne flag set to true. These messages are sent to the subscriber with the highest priority. Subscribers have two priorities; this priority is for messages published locally.
- The valid range is 1..4
Deprecated: Use Shared Subscriptions instead
public
Number
subscriberNetworkPriority
= 1
1
Subscriber priorities are used by the Solace Message Router to distribute messages that have the solace.Message#setDeliverToOne flag set to true. These messages are sent to the subscriber with the highest priority.
Subscribers have two priorities; this priority is for messages published on Solace Message Routers other than the one that the client is connected to.
- The valid range is 1..4
Deprecated: Use Shared Subscriptions instead
public
String | Array.<String>
url
= ""
""
The URL or URLs of the messaging service to connect to. The URL is typically of the form
<protocol>://<host[:port]>
, where:
protocol
is one ofws
,wss
,http
,https
,tcp
ortcps
. (Note to developers who also use the browser variant of this SDK: Browsers do not support thetcp
andtcps
protocols.)host
is a hostname or IP address of the router to connect to.port
is the port on which the messaging service is listening. The default is the well-known port for the service associated with the given protocol, if any.
Additionally, note:
- When an Array is provided, each element is expected to be a string of the above format. The API will attempt to connect to these URLs in the specified order.
- Numerical IPv6 addresses must be enclosed in square brackets, e.g. tcp://[2001:db8::1]
public
readonly String
userIdentification
= ""
""
A read-only string providing information about the application, such as the name of operating system that is running the application.
public
String
userName
= ""
""
The client username required for authentication.
public
readonly String
virtualRouterName
= ""
""
A read-only property that indicates the connected Solace Message Router's virtual router name.
public
String
vpnName
= ""
""
The Message VPN name that the client is requesting for this session.
public
readonly String
vpnNameInUse
= ""
""
A read-only session property that indicates which Message VPN the session is connected to. When not connected, or when not in client mode, an empty string is returned.
Methods Detail Top
public
String
toString
( )
Returns a human-readable representation of this Session, subject to change.