Interface FanOutConnectionConfig
- All Superinterfaces:
Config
When starting fan-out, if a fan-out client is unable to connect to the
primary server, it will try again after the specified
retry delay period
.
Upon losing the connection to the primary server the recovery process will
depend upon whether a reconnect timeout
has
been configured. If reconnection is configured, the client will try to
re-establish the connection until the specified amount of time has passed. It
will wait for the configured retry delay period between attempts.
If reconnection succeeds after a lost connection, fan-out will resume
seamlessly. However, if reconnection fails, the replicated topic tree will be
deleted and a new connection attempt will be rescheduled after the
retry delay
.
A load balancer may be used between secondary and primary server. If a load balancer is used and reconnection is configured, the load balancer should be configured for sticky routing.
- Since:
- 5.6
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Adds a topic tree link to be replicated.int
Deprecated.Returns the connection timeout.int
Deprecated.Returns the input buffer size.Deprecated.Get a named fan-out replication link.getLinks()
Deprecated.Returns a list of the replication links.int
Deprecated.Returns the maximum queue size.getName()
Deprecated.Gets the connection name.int
Deprecated.Returns the output buffer size.Deprecated.Returns the password.Deprecated.Returns the security principal.int
Deprecated.Returns the reconnect timeout value.int
Deprecated.Returns the recovery buffer size.int
Deprecated.Get the retry delay value.getUrl()
Deprecated.Returns the URL of the primary server to connect to.int
Deprecated.Returns the write timeout.void
setConnectionTimeout
(int timeout) Deprecated.Sets the connection timeout.void
setInputBufferSize
(int size) Deprecated.Sets the input buffer size for the connection.void
setMaximumQueueSize
(int queueSize) Deprecated.Sets the maximum queue size for messages queued to be sent to the primary server.void
setOutputBufferSize
(int size) Deprecated.Sets the output buffer size.void
setPassword
(String password) Deprecated.Sets a password to be used when authenticating with the primary server.void
setPrincipal
(String principal) Deprecated.Sets the security principal to use when authenticating with the primary server.void
setReconnectTimeout
(int timeout) Deprecated.Sets the overall reconnection timeout value.void
setRecoveryBufferSize
(int size) Deprecated.Set the recovery buffer size.void
setRetryDelay
(int delay) Deprecated.Specifies the number of milliseconds to wait after failing to connect or losing the connection to the primary server before trying to connect again.void
setWriteTimeout
(int timeout) Deprecated.Sets the write timeout value.
-
Method Details
-
getName
String getName()Deprecated.Gets the connection name.- Returns:
- connection name
- Since:
- 6.0
-
getUrl
String getUrl()Deprecated.Returns the URL of the primary server to connect to.- Returns:
- the URL
-
setRetryDelay
Deprecated.Specifies the number of milliseconds to wait after failing to connect or losing the connection to the primary server before trying to connect again.If not explicitly specified, 1000ms (1 second) is assumed.
- Parameters:
delay
- retry delay in milliseconds- Throws:
ConfigException
- if the interval is invalid- Since:
- 5.9
-
getRetryDelay
int getRetryDelay()Deprecated.Get the retry delay value.- Returns:
- retry delay in milliseconds
- Since:
- 5.9
-
setPrincipal
Deprecated.Sets the security principal to use when authenticating with the primary server.By default this will be "" representing an anonymous session.
- Parameters:
principal
- the principal- Throws:
ConfigException
- ifprincipal
is null
-
getPrincipal
String getPrincipal()Deprecated.Returns the security principal.- Returns:
- the principal
-
setPassword
Deprecated.Sets a password to be used when authenticating with the primary server.If not explicitly specified, it is assumed that no credentials are required for the connection.
- Parameters:
password
- the password- Throws:
ConfigException
- ifpassword
is null
-
getPassword
String getPassword()Deprecated.Returns the password.- Returns:
- password or null if no credentials specified
-
setConnectionTimeout
Deprecated.Sets the connection timeout.The value constrains the time taken to establish a TCP connection to the server. The
write timeout
constrains the time taken to send the connection request. The server is responsible for limiting the overall time taken to complete a connection once it has received the request.If not specified, a value of 2 seconds is used.
- Parameters:
timeout
- value in milliseconds. If this exceeds one hour (3600000ms) a warning will be logged and the time-out will be set to one hour.- Throws:
ConfigException
- if an illegal timeout value is supplied
-
getConnectionTimeout
int getConnectionTimeout()Deprecated.Returns the connection timeout.- Returns:
- connection timeout
-
setWriteTimeout
Deprecated.Sets the write timeout value.This only constrains the writing of the initial connection request. If it is not possible to complete the write within this time, the connection is closed.
If not specified, a value of 2 seconds is used.
- Parameters:
timeout
- value in milliseconds. If this exceeds one hour (3600000ms) a warning will be logged and the time-out will be set to one hour.- Throws:
ConfigException
- iftimeout
is invalid
-
getWriteTimeout
int getWriteTimeout()Deprecated.Returns the write timeout.- Returns:
- write timeout
-
setInputBufferSize
Deprecated.Sets the input buffer size for the connection.By default this is the same as the maximum message size. Setting to a larger value may improve throughput. Ideally the value should match the output buffer size configured at the primary server for the connector indicated by the url used for connection.
- Parameters:
size
- input buffer size in bytes. This must not be less than the maximum message size and hence may not be less than 1024- Throws:
ConfigException
- if the input buffer size is invalid
-
getInputBufferSize
int getInputBufferSize()Deprecated.Returns the input buffer size.- Returns:
- the input buffer size
-
setOutputBufferSize
Deprecated.Sets the output buffer size.By default this is the same as the maximum message size but increasing it can improve throughput.
- Parameters:
size
- output buffer size in bytes. This must not be less than the maximum message size and hence may not be less than 1024- Throws:
ConfigException
- if the output buffer size is invalid
-
getOutputBufferSize
int getOutputBufferSize()Deprecated.Returns the output buffer size.- Returns:
- the output buffer size
-
setReconnectTimeout
Deprecated.Sets the overall reconnection timeout value.This is the total amount of time that a fan-out client will spend attempting to reconnect to the primary server after losing the connection.
If not explicitly specified, a value of 0 is assumed which means that reconnect is not enabled.
- Parameters:
timeout
- the period of time (specified in milliseconds) that the client should allow to pass whilst attempting to reconnect to the primary server after a disconnection, before abandoning the reconnection process. A value of zero indicates that reconnection should not be performed (a new connection may still be attempted later after theretry
period).- Throws:
ConfigException
- if the timeout value is invalid.- Since:
- 5.9
-
getReconnectTimeout
int getReconnectTimeout()Deprecated.Returns the reconnect timeout value.- Returns:
- reconnect timeout in milliseconds. A value of 0 indicates that reconnection is not enabled.
- Since:
- 5.9
-
setRecoveryBufferSize
Deprecated.Set the recovery buffer size.If the primary server is configured to support reconnection, a session established with a non-zero
reconnection timeout
retains a buffer of sent messages. If the session disconnects and reconnects, this buffer is used to re-send messages that the server has not received.If not explicitly specified, 10000 is assumed.
- Parameters:
size
- the recovery buffer size in messages- Throws:
ConfigException
- if the specifiedsize
is negative- Since:
- 5.9
-
getRecoveryBufferSize
int getRecoveryBufferSize()Deprecated.Returns the recovery buffer size.- Returns:
- recovery buffer size as number of messages
- Since:
- 5.9
-
setMaximumQueueSize
Deprecated.Sets the maximum queue size for messages queued to be sent to the primary server.This specifies the maximum size that the queue of messages for the primary server may reach before the connection is closed. This must be able to cater for messages that may be queued whilst disconnected awaiting reconnection.
If this is not explicitly specified, 10000 is assumed.
- Parameters:
queueSize
- the maximum queue size- Throws:
ConfigException
- if the specifiedqueueSize
is invalid- Since:
- 5.9
-
getMaximumQueueSize
int getMaximumQueueSize()Deprecated.Returns the maximum queue size.- Returns:
- maximum queue size
- Since:
- 5.9
-
addLink
Deprecated.Adds a topic tree link to be replicated. The link represents a selection of the topic tree at the primary server.Any topics that are selected by the specified selector will be replicated at the secondary server assuming they are of types that can be replicated.
At least one such link should be specified for each connection but any number can be configured in order to separate segments of the topic tree.
Care must be taken to ensure that topic tree segments do not overlap with other links or with other connections. If the same topics are selected from different primary servers, errors could occur when creating replicated topics.
- Parameters:
name
- the name of the linkselector
- the selector associated with the link- Returns:
- the new link config object which may be used to specify further configuration details for the link
- Throws:
ConfigException
- if the name or selector are not supplied or there is already a link defined with the same name or selector- Since:
- 6.0
-
getLink
Deprecated.Get a named fan-out replication link.- Parameters:
name
- the name of the link.- Returns:
- a configuration object representing the link.
- Since:
- 6.0
-
getLinks
List<FanOutLinkConfig> getLinks()Deprecated.Returns a list of the replication links.- Returns:
- list of replicated links
-
Fan-out is deprecated and will be removed in a future release. Use Remote Servers in preference.