Version: 10.16.0
Class

solace.SessionProperties

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

String accessToken = ""
String applicationDescription = ""
Number assumedMaxAdSize = 30000000
solace.AuthenticationScheme authenticationScheme = solace.AuthenticationScheme.BASIC
String clientName = ""
Number compressionLevel = 0
Number connectRetries = 20
Number connectRetriesPerHost = 0
Number connectTimeoutInMsecs = 8000
Boolean generateReceiveTimestamps = false
Boolean generateSendTimestamps = false
Boolean generateSequenceNumber = false
String idToken = ""
Boolean ignoreDuplicateSubscriptionError = true
Boolean ignoreSubscriptionNotFoundError = true
Boolean includeSenderId = false
String issuerIdentifier = ""
Number keepAliveIntervalInMsecs = 3000
Number keepAliveIntervalsLimit = 3
Number maxWebPayload = 1048576 (1MB)
Boolean noLocal = false
readonly String p2pInboxInUse = ""
String password = ""
solace.MessagePublisherProperties | null | undefined publisherProperties = undefined
Number readTimeoutInMsecs = 10000
Boolean reapplySubscriptions = false
Number reconnectRetries = 20
Number reconnectRetryWaitInMsecs = 3000
Number sendBufferMaxSize = 65536 (64KB)
String sslCertificate = empty string
String sslCipherSuites = solace.SessionProperties.DEFAULT_CIPHER_SUITES
solace.SslDowngrade sslConnectionDowngradeTo = solace.SslDowngrade.NONE
Array.<String> sslExcludedProtocols = null
String sslPfx = ""
String sslPfxPassword = empty string
String sslPrivateKey = empty string
String sslPrivateKeyPassword = empty string
Array.<String> sslTrustedCommonNameList = null
Array.<String> sslTrustStores = null
Boolean sslValidateCertificate = true
Number subscriberLocalPriority = 1
Number subscriberNetworkPriority = 1
String | Array.<String> url = ""
readonly String userIdentification = ""
String userName = ""
readonly String virtualRouterName = ""
String vpnName = ""
readonly String vpnNameInUse = ""

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.

Parameters

Object options

Properties to apply to the newly constructed object.

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.

public String applicationDescription = ""

A string that uniquely describes the application instance.

public Number assumedMaxAdSize = 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 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.

public Number compressionLevel = 0

zlib compression level (1-9) or no compression (0)

When this property is set to a valid, non-zero value (1-9):

public Number connectRetries = 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.

public Number connectRetriesPerHost = 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.

public Number connectTimeoutInMsecs = 8000

The timeout period (in milliseconds) for a connect operation to a given host. If no value is provided, the default is 8000.

public Boolean generateReceiveTimestamps = 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

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

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.

public Boolean ignoreDuplicateSubscriptionError = true

Used to ignore duplicate subscription errors on subscribe.

public Boolean ignoreSubscriptionNotFoundError = true

Used to ignore subscription not found errors on unsubscribe.

public Boolean includeSenderId = 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.

public Number keepAliveIntervalInMsecs = 3000

The amount of time (in milliseconds) to wait between sending out keep-alive messages to the Solace Message Router.

public Number keepAliveIntervalsLimit = 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.

public Number maxWebPayload = 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.

public Boolean noLocal = 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 solace.MessagePublisherProperties | null | undefined publisherProperties = undefined

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

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.

public Boolean reapplySubscriptions = 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

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.

public Number reconnectRetryWaitInMsecs = 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)

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.

public String sslCertificate = empty string

The file name of a file containing certificate key of the client in PEM format.

public String sslCipherSuites = solace.SessionProperties.DEFAULT_CIPHER_SUITES

A comma separated list of cipher suites in order of preference used for TLS connections.

public solace.SslDowngrade sslConnectionDowngradeTo = solace.SslDowngrade.NONE

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

An array of TLS protocols to be excluded when negotiating which protocol to use.

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.

public String sslPfxPassword = empty string

A string containing password for the client pfx file.

public String sslPrivateKey = empty string

The file name of a file containing private key of the client in PEM format.

public String sslPrivateKeyPassword = empty string

A string containg password for the client private key.

public Array.<String> sslTrustedCommonNameList = 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.

public Array.<String> sslTrustStores = 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.

public Boolean sslValidateCertificate = 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

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.

Deprecated: Use Shared Subscriptions instead

public Number subscriberNetworkPriority = 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.

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:

Additionally, note:

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.

Return Value

String

A brief description of this object