## Contents

- Constants
- Properties
- Methods

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 = `""` |  |
solace.AuthenticationScheme | authenticationScheme = `solace.AuthenticationScheme.BASIC` |  |
String | clientName = `""` |  |
Number | connectRetries = `20` |  |
Number | connectRetriesPerHost = `0` |  |
Number | connectTimeoutInMsecs = `max(8000, 1000 + webTransportProtocolList.length * transportDowngradeTimeoutInMsecs)` |  |
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 | publisherProperties |  |
Number | readTimeoutInMsecs = `10000` |  |
Boolean | reapplySubscriptions = `false` |  |
Number | reconnectRetries = `20` |  |
Number | reconnectRetryWaitInMsecs = `3000` |  |
Number | sendBufferMaxSize = `65536 (64KB)` |  |
Number | subscriberLocalPriority = `1` |  |
Number | subscriberNetworkPriority = `1` |  |
Number | transportDowngradeTimeoutInMsecs = `3000` |  |
solace.TransportProtocol | transportProtocol = `null` |  |
readonly String | transportProtocolInUse |  |
String | Array.<String> | url = `""` |  |
readonly String | userIdentification = `""` |  |
String | userName = `""` |  |
readonly String | virtualRouterName = `""` |  |
String | vpnName = `""` |  |
readonly String | vpnNameInUse = `""` |  |
readonly String | webTransportProtocolInUse |  |
Array.<solace.TransportProtocol> | webTransportProtocolList = `null` |  |

## 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.

- 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 solace.AuthenticationScheme authenticationScheme = `solace.AuthenticationScheme.BASIC`

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 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.

- 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`

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 = `max(8000, 1000 + webTransportProtocolList.length * transportDowngradeTimeoutInMsecs)`

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

- The valid range is > 0.

###
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.

- This is only relevant if the solace.AuthenticationScheme.OAUTH2 authentication scheme is being used.

###
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.

- This is only relevant if the solace.AuthenticationScheme.OAUTH2 authentication scheme is being used.

###
public Number keepAliveIntervalInMsecs = `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`

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)`

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`

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 publisherProperties

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.

- The valid range is >= 0.

###
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.

- 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`

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.

- The valid range is > 0.

###
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.

- The valid range is 1..4

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.

- The valid range is 1..4

Deprecated: Use Shared Subscriptions instead

###
public Number transportDowngradeTimeoutInMsecs = `3000`

The timeout, in milliseconds, that must elapse before the session will abandon a connection attempt with the current transport protocol if no response is received, and begin a new connection attempt with a downgraded transport protocol. If no remaining downgrades exist, the session will continue the current connection attempt until the connection timeout expires. Note that the WS_BINARY transport will also attempt a downgrade if the underlying WebSocket fails to connect before this period elapses.

- The valid range is > 0.

###
public solace.TransportProtocol transportProtocol = `null`

This property is deprecated. It is recommended to use solace.SessionProperties#webTransportProtocolList instead, which explicitly lists all web transport protocols that may be used when establishing a session.

This property specifies the web transport protocol that will initially be selected by the session for its connection attempt. If this protocol fails, the session will attempt other protocols in accordance with its transport protocol connect policy.

If solace.FactoryProfile#cometEnabled is `true`, the selection of any solace.TransportProtocol will result in the inclusion of fallback protocols in solace.SessionProperties#webTransportProtocolList. This makes the session incompatible with Guaranteed Messaging.

To create a Guaranteed Messaging compatible session with solace.FactoryProfile#cometEnabled set to `true`, ensure the session's solace.SessionProperties#webTransportProtocoList is set to only solace.TransportProtocol.WS_BINARY.

- Mutually exclusive to property webTransportProtocolList

Deprecated: Yes

###
public readonly String transportProtocolInUse

This property is deprecated. Use solace.SessionProperties#webTransportProtocolInUse instead.

Deprecated: Yes

###
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 of `ws`, `wss`, `http`, `https'. (Note to developers who also ise the NodeJS variant of this SDK: NodeJS also supports the 'tcp' and 'tcps' protocols, but browsers do not.)
- `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.
- Cross-domain restrictions should be taken into consideration when deploying web applications with messaging capabilities. See the API User Guide for more information.
- Numerical IPv6 addresses must be enclosed in square brackets, e.g. ws://[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.

###
public readonly String webTransportProtocolInUse

A read-only property about the web transport protocol that is currently being used by the session for its current connection or connection attempt. To determine which web transport protocol was successfully used by the API, interrogate this property after the session event UP_NOTICE is dispatched.

###
public Array.<solace.TransportProtocol> webTransportProtocolList = `null`

The user provided web transport protocol list indicating the initial protocol to be used by the session for its connection attempt, and the protocols to try subsequently if the attempt fails.

- Mutually exclusive to property transportProtocol

## 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