public interface ServerConfig extends Config
Suitable defaults exist for all configurable values (see below) so it is possible to create a working server without any special configuration being set.
At least one connector should be configured to allow client connections. However, if no connectors are configured when the server is started then two default connectors will be automatically created as follows:-
1) "Client Connector"
Using a default web server (see below) and listening on port 8080.
All other configuration values will default.
This connector would be suitable for normal client connections.
2) "High Volume Connector"
Using a default web server (see below) and listening on port 8090.
This will use the "LargeQueue" queue definition. If this queue does not exist
it will be created with a maximum depth of 100,000.
It will have input and output socket buffers configured at 1Mb and a recovery
buffer size of 10,000.
This connector would be suitable for high throughput connections, such a
secondary fan-out servers or bulk updater clients.
If connectors need to be set up automatically then they will use the first configured web server. If no web server has been configured then one will be created called "default" which will be suitable for web socket client connections and supporting an HTTP prometheus service.
Modifier and Type | Method and Description |
---|---|
ConnectorConfig |
addConnector(String name)
Add a connector.
|
WebServerConfig |
addWebServer(String webServerName)
Add a new Web Server Configuration.
|
ConnectorConfig |
getConnector(String name)
Get the configuration for a named connector.
|
List<ConnectorConfig> |
getConnectors()
Returns the list of connectors defined for this server.
|
FanOutConfig |
getFanOut()
Get the FanOut configuration.
|
FormattingConfig |
getFormatting()
Gets the formatting (e.g dates) configuration.
|
GeoIpConfig |
getGeoIp()
Gets the Geo IP config details.
|
HooksConfig |
getHooks()
Gets the Server Hooks Configuration.
|
LoggingConfig |
getLogging()
Get the logging configuration.
|
ManagementConfig |
getManagement()
Get Management configuration.
|
int |
getMaximumMessageSize()
Returns the configured maximum message size.
|
MimesConfig |
getMimes()
Get mime types configuration.
|
MultiplexerConfig |
getMultiplexerConfiguration()
Get the multiplexer configuration.
|
PersistenceConfig |
getPersistence()
Get the persistence configuration details.
|
String |
getPersistenceDirectory()
Returns the persistence home directory, if one has been specified.
|
QueuesConfig |
getQueues()
Gets the queues configuration details.
|
ReplicationConfig |
getReplication()
Get replication configuration.
|
SecurityConfig |
getSecurity()
Gets the security configuration details.
|
SelectorThreadPoolsConfig |
getSelectorThreadPools()
Gets the selector thread pools configuration.
|
String |
getServerName()
Returns the server name.
|
StatisticsConfig |
getStatistics()
Get statistics configuration.
|
ThreadsConfig |
getThreads()
Gets the Threads configuration.
|
TimeoutsConfig |
getTimeouts()
Gets the timeouts configuration.
|
UserLibrariesConfig |
getUserLibraries()
Gets the user library configuration.
|
WebServerConfig |
getWebServer(String webServerName)
Get a named Web Server configuration.
|
List<WebServerConfig> |
getWebServers()
Gets the list of configured web servers.
|
WhoIsConfig |
getWhois()
Deprecated.
since 6.4
Who-Is style lookups are better performed within authentication handlers and therefore the WhoIs service will be withdrawn in a future release |
void |
setMaximumMessageSize(int maxMessageSize)
Sets the maximum message size.
|
void |
setPersistenceDirectory(String path)
Sets the name of a directory under which persistent files will be
maintained.
|
void |
setServerName(String name)
Sets the server name.
|
void setServerName(String name) throws ConfigException
The server name is used to identify this server if running in a cluster. This will also be used as a prefix for client IDs.
If not specified the local host name will be used.
name
- the server nameConfigException
- if unable to set the server nameString getServerName()
void setPersistenceDirectory(String path) throws ConfigException
This may be an absolute or relative directory path. If relative then the directory will be beneath the Diffusion home directory.
If this is not specified, the setting in
PersistenceConfig.getStoreDirectory()
will be considered, but if
not specified there then a directory called 'persistence' under the
Diffusion home directory will be used.
The directory will be created if it does not already exist when the server starts.
path
- specifies an absolute or relative (to the Diffusion home
directory) path for the directory which is to contain persistence
filesConfigException
- if the configuration is locked
String getPersistenceDirectory()
setPersistenceDirectory(String)
void setMaximumMessageSize(int maxMessageSize) throws ConfigException
This is used as a safeguard as a size that no inbound message may exceed.
maxMessageSize
- The maximum message size in bytes. This defines the
maximum message size (including headers) that can be received. The
default is 32 KiB.ConfigException
- if the specified maximum message size is invalid.int getMaximumMessageSize()
TimeoutsConfig getTimeouts()
This allows connection timeouts to be configured.
ThreadsConfig getThreads()
This allows concurrency related properties to be configured, including defining thread pools.
FormattingConfig getFormatting()
This allows date and time formats to be configured.
List<ConnectorConfig> getConnectors()
ConnectorConfig getConnector(String name)
name
- the connector nameConnectorConfig addConnector(String name) throws ConfigException
Connectors may only be configured before the server is started.
name
- the connector nameConfigException
- if unable to add connectorMultiplexerConfig getMultiplexerConfiguration()
List<WebServerConfig> getWebServers()
WebServerConfig getWebServer(String webServerName)
webServerName
- the web server nameWebServerConfig addWebServer(String webServerName) throws ConfigException
Web server configurations are used to specify the Web server behavior of connectors that wish to handle HTTP connections or act as file servers.
webServerName
- the Web Server Name which must be unique.ConfigException
- if unable to add Web Server configurationSecurityConfig getSecurity()
This allows server specific security details such as the name of an authorisation handler class.
@Deprecated WhoIsConfig getWhois()
Who-Is style lookups are better performed within authentication handlers and therefore the WhoIs service will be withdrawn in a future release
This allows details relating to the Who Is service to be defined. The service is used to resolve client connection information.
GeoIpConfig getGeoIp()
This allows details relating o the GeoIp database to be defined. Normally this would not need to be changed in any way as default behavior is usually what is required.
UserLibrariesConfig getUserLibraries()
This allows a set of user libraries from which user written code may be loaded to be defined.
HooksConfig getHooks()
This allows server hooks such as startUp and shutDown hooks to be defined.
ManagementConfig getManagement()
This allows system management details to be defined.
MimesConfig getMimes()
Common mime types used in HTTP deployments.
StatisticsConfig getStatistics()
Allows the statistics that are to be produced to be configured.
At this point in time this is minimal.
ReplicationConfig getReplication()
The replication configuration is used to control the replication of sessions or topics across a cluster.
LoggingConfig getLogging()
This allows logging properties to be configured.
SelectorThreadPoolsConfig getSelectorThreadPools()
FanOutConfig getFanOut()
This is used to configure a secondary server to connect to a primary server in fan out mode.
QueuesConfig getQueues()
This allows queue definitions to be configured.
PersistenceConfig getPersistence()
This is used to configure the topic persistence service.
Copyright © 2021 Push Technology Ltd. All Rights Reserved.