Interface SessionConfig
- All Known Subinterfaces:
ConnectorConfig
- Since:
- 6.2
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Compression schemes. -
Method Summary
Modifier and TypeMethodDescriptionGet the compression schemes supported by this connector.int
The maximum message size to use for the connector.long
Gets the maximum number of bytes that can be used by all outbound message queues of sessions using this connector.Gets the queue definition.Gets the Reconnect Configuration.long
Gets the system ping frequency.void
Set the compression schemes supported by this connector.void
setMaximumQueuedBytes
(long maximumQueuedBytes) Sets the maximum number of bytes that can be used by all outbound message queues of sessions using this connector.void
setQueueDefinition
(String queueDefinition) Sets the queue definition.void
setSystemPingFrequency
(long frequency) Sets the system ping frequency.
-
Method Details
-
setQueueDefinition
Sets the queue definition.Optional queue definition for this connector. The definition must have been defined in the
QueuesConfig
for the owningServerConfig
. If not specified, the default for the server will be used.- Parameters:
queueDefinition
- name of configured queue definition.- Throws:
ConfigException
- if unable to set the property
-
getQueueDefinition
String getQueueDefinition()Gets the queue definition.- Returns:
- queue definition or null if none defined for this connector.
-
getReconnect
ReconnectConfig getReconnect()Gets the Reconnect Configuration.This specifies optional client reconnection properties.
- Returns:
- Reconnection configuration.
-
setSystemPingFrequency
Sets the system ping frequency.This is the idle time (no inbound messages) before a client will be pinged by the server. A response must be received by Diffusion before the next interval, else the client is considered to be disconnected.
If this is not explicitly set, no system pings will be performed.
- Parameters:
frequency
- a time in milliseconds between connection activity and a client being pinged. If this is 0, no system pings will be performed.- Throws:
ConfigException
- if unable to set the property
-
getSystemPingFrequency
long getSystemPingFrequency()Gets the system ping frequency.- Returns:
- system ping frequency value in milliseconds. A value of 0 indicates that no system pings will be performed.
-
getMaximumQueuedBytes
long getMaximumQueuedBytes()Gets the maximum number of bytes that can be used by all outbound message queues of sessions using this connector.- Returns:
- the maximum number of bytes that can be used by all outbound message queues of sessions using this connector
- Since:
- 6.1
-
setMaximumQueuedBytes
Sets the maximum number of bytes that can be used by all outbound message queues of sessions using this connector.If the number of bytes queued exceeds this maximum, the server may attempt to free some memory by compacting the message queues. If the number of bytes remains above this maximum, sessions will be closed to free memory. If not specified, the maximum number of bytes is assumed to be
Long.MAX_VALUE
.This is considered separately from
QueueConfig.getMaximumDepth()
andQueueConfig.getMaximumBytes()
.- Parameters:
maximumQueuedBytes
- the maximum queued bytes- Throws:
ConfigException
- if the maximum queued bytes is not positive- Since:
- 6.1
-
setCompressionSchemes
Set the compression schemes supported by this connector.The server will use this setting to select an appropriate compression scheme for each session using this connector based on the capabilities declared by the client. The Java, Android, .NET and JavaScript client libraries all support the
ZLIB
compression scheme. A JavaScript client must explicitly download the zlib library; it is packaged separately to reduce the download size of the core library.By default, all compression schemes are supported.
- Parameters:
schemes
- the supported schemes; may be empty to disable compression- Throws:
ConfigException
- if unable to set the property- Since:
- 6.2
-
getCompressionSchemes
Set<SessionConfig.CompressionScheme> getCompressionSchemes()Get the compression schemes supported by this connector.- Returns:
- the supported schemes; may be empty
- Since:
- 6.2
-
getMaximumMessageSize
int getMaximumMessageSize()The maximum message size to use for the connector.Currently this is taken from the server configuration and cannot be customised per connector.
- Returns:
- maximum message size in bytes
- Since:
- 6.4
-