Version: 10.17.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 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 = ""
Number payloadCompressionLevel = 0
solace.MessagePublisherProperties | null | undefined publisherProperties = undefined
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 = null
String | Array.<String> url = ""
readonly String userIdentification = ""
String userName = ""
readonly String virtualRouterName = ""
String vpnName = ""
readonly String vpnNameInUse = ""
readonly String webTransportProtocolInUse = null
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.

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

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 Number payloadCompressionLevel = 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:

Values 1-9 are passed straight to zlib, 0 disables the payload compression feature on outgoing messages. No impact on payload-compressed incoming messages.

Default: 0

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

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.

Deprecated: Yes

public readonly String transportProtocolInUse = null

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:

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.

public readonly String webTransportProtocolInUse = null

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.

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