Class AxonServerConfiguration
- Since:
- 4.0
- Author:
- Marc Gathier, Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classConfiguration class for Flow Control of specific message types.static classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiate aAxonServerConfiguration.Builderto create anAxonServerConfiguration.Return the settings for all persistent streams that will be created automatically.The path to the certificate file used for SSL.The client identifier as it registers itself to Axon Server, must be unique.Specificflow control settingsfor the command message stream.intAnintrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured.intThe number of threads executing commands.intThe timeout (in milliseconds) to wait for response on commit.The name of this application.intThe number of threads that should be used for connection management activities by theAxonServerConnectionFactoryused by theAxonServerConnectionManager.longA value representing the maximum time in milliseconds a request for the initial Axon Server connection may last.The boundedcontextthat this application operates in.The defaultflow control settingsused when no specificcommand,event, orqueryflow control settings are provided.Deprecated.Through use of the Axon Server Java Connector project.Specific flow control settings for the event message stream.Return the configuredAxonServerConfiguration.Eventhandlingof this application for Axon Server.Return the configuredAxonServerConfiguration.EventStoreConfigurationof this application for Axon Server.The configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.Deprecated.In favor ofgetPermits()longThe interval (in ms) for keep alive requests, 0 is keep-alive disabled.longThe timeout (in ms) for keep alive requests.intDeprecated.This property is no longer used through adjustments in the Axon Server Java Connector project.intThe gRPC max inbound message size.doubleThe threshold (in percentage of 0-1) of the max message size at which a warning should be logged.The threshold at which the application sends new permits to server.Additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.The initial number of permits send for message streams (events, commands, queries).Returns the settings for each of the configured persistent streams, by name.intThe initial delay (in ms.) before application sends first status update on event processors to Axon Server.intThe interval (in ms.) application sends status updates on event processors to Axon Server.Specificflow control settingsfor the query message stream.intThe number of threads executing query responses.intThe number of threads executing queries.longThe amount of time in milliseconds to wait in between attempts to connect to Axon Server.Comma separated list of Axon Server servers.intAnintindicating the maximum number of Aggregate snapshots which will be retrieved.booleanDeprecated.Through use of the Axon Server Java Connector project, which enables the download message in absence of configured servers.getToken()The token providing access control with Axon ServerbooleanbooleanDeprecated.In favor ofsetEventBlockListingEnabled(boolean).booleanWhether (automatic) configuration of the Axon Server Connector is enabled.booleanFlag that allows block-listing of event types to be enabled.booleanIndicates whether it is OK to query events from the local Axon Server node - the node the client is currently connected to.booleanIndicates whether theAxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.booleanbooleanA toggle dictating whether to use TLS for the connection to Axon ServerList<io.axoniq.axonserver.grpc.control.NodeInfo> Deprecated.In favor of theAxonServerConnectionManageritself being in charge of parsing thegetServers()list into aNodeInfocollection.voidsetAutoPersistentStreamsEnable(boolean autoPersistentStreamsEnable) voidsetAutoPersistentStreamsSettings(AxonServerConfiguration.PersistentStreamSettings autoPersistentStreamsSettings) voidsetCertFile(String certFile) Sets the path to the certificate file used for SSL.voidsetClientId(String clientId) Sets the client identifier as it registers itself to Axon Server, must be unique.voidsetCommandFlowControl(AxonServerConfiguration.FlowControlConfiguration commandFlowControl) Sets specificflow control settingsfor the command message stream.voidsetCommandLoadFactor(int commandLoadFactor) Sets anintrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured.voidsetCommandThreads(int commandThreads) Sets the number of threads executing commands.voidsetCommitTimeout(int commitTimeout) Sets the timeout (in milliseconds) to wait for response on commit.voidsetComponentName(String componentName) Sets the name of this application.voidsetConnectionManagementThreadPoolSize(int connectionManagementThreadPoolSize) Define the number of threads that should be used for connection management activities by theAxonServerConnectionFactoryused by theAxonServerConnectionManager.voidsetConnectTimeout(long connectTimeout) Sets the value representing the maximum time in milliseconds a request for the initial Axon Server connection may last.voidsetContext(String context) Sets the boundedcontextthat this application operates in.voidsetDisableEventBlacklisting(boolean disableEventBlacklisting) Deprecated.In favor ofsetEventBlockListingEnabled(boolean).voidsetEnabled(boolean enabled) Set whether (automatic) configuration of the Axon Server Connector is enabled.voidsetEventBlockListingEnabled(boolean eventBlockListingEnabled) Sets flag that allows block-listing of event types to be enabled.voidsetEventFlowControl(AxonServerConfiguration.FlowControlConfiguration eventFlowControl) Sets specificflow control settingsfor the event message stream.voidsetEventhandling(AxonServerConfiguration.Eventhandling eventhandling) Set theAxonServerConfiguration.Eventhandlingof this application for Axon ServervoidsetEventStoreConfiguration(AxonServerConfiguration.EventStoreConfiguration eventStoreConfiguration) Set theAxonServerConfiguration.EventStoreConfigurationof this application for Axon ServervoidsetForceReadFromLeader(boolean forceReadFromLeader) Sets the indicator whether it is OK to query events from the local Axon Server node - the node the client is currently connected to.voidsetForceReconnectThroughServers(boolean forceReconnectThroughServers) Sets the indicator whether theAxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.voidSets the configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.voidsetInitialNrOfPermits(Integer initialNrOfPermits) Deprecated.In favor ofsetPermits(Integer)voidsetKeepAliveTime(long keepAliveTime) Sets the interval (in ms) for keep alive requests, 0 is keep-alive disabled.voidsetKeepAliveTimeout(long keepAliveTimeout) Sets the timeout (in ms) for keep alive requests.voidsetMaxGrpcBufferedMessages(int maxGrpcBufferedMessages) Deprecated.This property is no longer used through adjustments in the Axon Server Java Connector project.voidsetMaxMessageSize(int maxMessageSize) Sets the gRPC max inbound message size.voidsetMaxMessageSizeWarningThreshold(double maxMessageSizeWarningThreshold) The threshold (in percentage of 0-1) of the max message size at which a warning should be logged.voidsetNewPermitsThreshold(Integer newPermitsThreshold) Sets the threshold at which the application sends new permits to server.voidsetNrOfNewPermits(Integer nrOfNewPermits) Sets the additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.voidsetPermits(Integer permits) Sets the initial number of permits send for message streams (events, commands, queries).voidsetProcessorsNotificationInitialDelay(int processorsNotificationInitialDelay) Sets the initial delay (in ms.) before application sends first status update on event processors to Axon Server.voidsetProcessorsNotificationRate(int processorsNotificationRate) Sets the interval (in ms.) application sends status updates on event processors to Axon Server.voidsetQueryFlowControl(AxonServerConfiguration.FlowControlConfiguration queryFlowControl) Sets specificflow control settingsfor the query message stream.voidsetQueryResponseThreads(int queryResponseThreads) Sets the number of threads executing query responses.voidsetQueryThreads(int queryThreads) Sets the number of threads executing queries.voidsetReconnectInterval(long reconnectInterval) Sets the amount of time in milliseconds to wait in between attempts to connect to Axon Server.voidsetServers(String routingServers) Set the comma separated list of Axon Server servers.voidsetShortcutQueriesToLocalHandlers(boolean shortcutQueriesToLocalHandlers) voidsetSnapshotPrefetch(int snapshotPrefetch) Sets the maximum number of Aggregate snapshots which will be retrieved.voidsetSslEnabled(boolean sslEnabled) Defines whether to use TLS for the connection to Axon Server.voidsetSuppressDownloadMessage(boolean suppressDownloadMessage) Deprecated.Through use of the Axon Server Java Connector project, which enables the download message in absence of configured servers.voidSets the token providing access control with Axon Server.
-
Constructor Details
-
AxonServerConfiguration
public AxonServerConfiguration()Instantiate a defaultAxonServerConfiguration.
-
-
Method Details
-
builder
Instantiate aAxonServerConfiguration.Builderto create anAxonServerConfiguration.- Returns:
- a
AxonServerConfiguration.Builderto be able to create anAxonServerConfiguration.
-
isEnabled
public boolean isEnabled()Whether (automatic) configuration of the Axon Server Connector is enabled. Whenfalse, the connector will not be implicitly be configured. Defaults totrue.Note that this setting will only affect automatic configuration by Application Containers (such as Spring).
- Returns:
- Whether (automatic) configuration of the Axon Server Connector is enabled.
-
isShortcutQueriesToLocalHandlers
public boolean isShortcutQueriesToLocalHandlers() -
setShortcutQueriesToLocalHandlers
public void setShortcutQueriesToLocalHandlers(boolean shortcutQueriesToLocalHandlers) -
setEnabled
public void setEnabled(boolean enabled) Set whether (automatic) configuration of the Axon Server Connector is enabled. Whenfalse, the connector will not be implicitly be configured. Defaults totrue.Note that this setting will only affect automatic configuration by Application Containers (such as Spring).
- Parameters:
enabled- Whether (automatic) configuration of the Axon Server Connector is enabled.
-
getServers
Comma separated list of Axon Server servers. Each element is hostname or hostname:grpcPort. When no grpcPort is specified, default port 8124 is used.- Returns:
- Comma separated list of Axon Server servers.
-
routingServers
Deprecated.In favor of theAxonServerConnectionManageritself being in charge of parsing thegetServers()list into aNodeInfocollection.A list ofNodeInfoinstances based on the comma separated list ofgetServers().- Returns:
- A list of
NodeInfoinstances based on the comma separated list ofgetServers().
-
setServers
Set the comma separated list of Axon Server servers. Each element is hostname or hostname:grpcPort. When no grpcPort is specified, default port 8124 is used.- Parameters:
routingServers- The comma separated list of Axon Server servers to connect with.
-
getClientId
The client identifier as it registers itself to Axon Server, must be unique.- Returns:
- The client identifier as it registers itself to Axon Server, must be unique.
-
isAutoPersistentStreamsEnable
public boolean isAutoPersistentStreamsEnable() -
setAutoPersistentStreamsEnable
public void setAutoPersistentStreamsEnable(boolean autoPersistentStreamsEnable) -
getAutoPersistentStreamsSettings
Return the settings for all persistent streams that will be created automatically.Each persistent stream will be named according to the following pattern:
processingGroupName + "-stream"
- Returns:
- Return the settings for all persistent streams that will be created automatically.
-
setAutoPersistentStreamsSettings
public void setAutoPersistentStreamsSettings(AxonServerConfiguration.PersistentStreamSettings autoPersistentStreamsSettings) -
setClientId
Sets the client identifier as it registers itself to Axon Server, must be unique.- Parameters:
clientId- The client identifier as it registers itself to Axon Server, must be unique.
-
getComponentName
The name of this application. Multiple instances of the same application share the same application name, but each must have a differentclient identifier. Defaults tospring.application.namewhen not defined, and toUnnamed + client identifierwhenspring.application.nameisn't set.- Returns:
- The name of this application.
-
setComponentName
Sets the name of this application. Multiple instances of the same application share the same application name, but each must have a differentclient identifier. Defaults tospring.application.namewhen not defined, and toUnnamed + client identifierwhenspring.application.nameisn't set.- Parameters:
componentName- The name of this application.
-
getToken
The token providing access control with Axon Server.\- Returns:
- The token providing access control with Axon Server.
-
setToken
Sets the token providing access control with Axon Server.- Parameters:
token- The token providing access control with Axon Server.
-
getContext
The boundedcontextthat this application operates in. Defaults to"default".- Returns:
- The bounded
contextthat this application operates in.
-
setContext
Sets the boundedcontextthat this application operates in. Defaults to"default".- Parameters:
context- The boundedcontextthat this application operates in.
-
getCertFile
The path to the certificate file used for SSL. Note the path is only used whenSSL is enabled.- Returns:
- The path to the certificate file used for SSL.
-
setCertFile
Sets the path to the certificate file used for SSL. Note the path is only used whenSSL is enabled.- Parameters:
certFile- The path to the certificate file used for SSL.
-
isSslEnabled
public boolean isSslEnabled()A toggle dictating whether to use TLS for the connection to Axon Server.\- Returns:
- A toggle dictating whether to use TLS for the connection to Axon Server.
-
setSslEnabled
public void setSslEnabled(boolean sslEnabled) Defines whether to use TLS for the connection to Axon Server.- Parameters:
sslEnabled- The toggle dictating whether to use TLS for the connection to Axon Server.
-
getInitialNrOfPermits
Deprecated.In favor ofgetPermits() -
setInitialNrOfPermits
Deprecated.In favor ofsetPermits(Integer) -
getPermits
The initial number of permits send for message streams (events, commands, queries). Defaults to5000permits.- Returns:
- The initial number of permits send for message streams (events, commands, queries).
-
setPermits
Sets the initial number of permits send for message streams (events, commands, queries). Defaults to5000permits.- Parameters:
permits- The initial number of permits send for message streams (events, commands, queries).
-
getNrOfNewPermits
Additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.A value of
null, 0, and negative values will have the client request the number of permits required to get from the "new-permits-threshold" to "initial-nr-of-permits".- Returns:
- The additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.
-
setNrOfNewPermits
Sets the additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.A value of
null, 0, and negative values will have the client request the number of permits required to get from the "new-permits-threshold" to "initial-nr-of-permits".- Parameters:
nrOfNewPermits- The additional number of permits send for message streams (events, commands, queries) when application is ready for more messages.
-
getNewPermitsThreshold
The threshold at which the application sends new permits to server.A value of
null, 0, and negative values will have the threshold set to 50% ofthe initial number of permits.- Returns:
- The threshold at which the application sends new permits to server.
-
setNewPermitsThreshold
Sets the threshold at which the application sends new permits to server.A value of
null, 0, and negative values will have the threshold set to 50% ofthe initial number of permits.- Parameters:
newPermitsThreshold- The threshold at which the application sends new permits to server.
-
getEventCipher
Deprecated.Through use of the Axon Server Java Connector project. -
getEventFlowControl
Specific flow control settings for the event message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Returns:
- Specific flow control settings for the event message stream.
-
setEventFlowControl
Sets specificflow control settingsfor the event message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Parameters:
eventFlowControl- Specificflow control settingsfor the event message stream.
-
getQueryFlowControl
Specificflow control settingsfor the query message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Returns:
- Specific
flow control settingsfor the query message stream.
-
setQueryFlowControl
Sets specificflow control settingsfor the query message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Parameters:
queryFlowControl- Specificflow control settingsfor the query message stream.
-
getCommandFlowControl
Specificflow control settingsfor the command message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Returns:
- Specific
flow control settingsfor the command message stream.
-
setCommandFlowControl
public void setCommandFlowControl(AxonServerConfiguration.FlowControlConfiguration commandFlowControl) Sets specificflow control settingsfor the command message stream.When not specified (null) the top-level flow control properties
permits,nrOfNewPermitsandnewPermitsThresholdare used.- Parameters:
commandFlowControl- Specificflow control settingsfor the command message stream.
-
getDefaultFlowControlConfiguration
The defaultflow control settingsused when no specificcommand,event, orqueryflow control settings are provided.- Returns:
- The default
flow control settingsused when no specificcommand,event, orqueryflow control settings are provided.
-
getCommandThreads
public int getCommandThreads()The number of threads executing commands. Defaults to10threads.- Returns:
- The number of threads executing commands.
-
setCommandThreads
public void setCommandThreads(int commandThreads) Sets the number of threads executing commands. Defaults to10threads.- Parameters:
commandThreads- The number of threads executing commands.
-
getQueryThreads
public int getQueryThreads()The number of threads executing queries. Defaults to10threads.- Returns:
- The number of threads executing queries.
-
setQueryThreads
public void setQueryThreads(int queryThreads) Sets the number of threads executing queries. Defaults to10threads.- Parameters:
queryThreads- The number of threads executing queries.
-
getQueryResponseThreads
public int getQueryResponseThreads()The number of threads executing query responses. Defaults to5threads.- Returns:
- The number of threads executing query responses.
-
setQueryResponseThreads
public void setQueryResponseThreads(int queryResponseThreads) Sets the number of threads executing query responses. Defaults to5threads.- Parameters:
queryResponseThreads- The number of threads executing query responses.
-
getProcessorsNotificationRate
public int getProcessorsNotificationRate()The interval (in ms.) application sends status updates on event processors to Axon Server. Defaults to500milliseconds.- Returns:
- The interval (in ms.) application sends status updates on event processors to Axon Server.
-
setProcessorsNotificationRate
public void setProcessorsNotificationRate(int processorsNotificationRate) Sets the interval (in ms.) application sends status updates on event processors to Axon Server. Defaults to500milliseconds.- Parameters:
processorsNotificationRate- The interval (in ms.) application sends status updates on event processors to Axon Server.
-
getProcessorsNotificationInitialDelay
public int getProcessorsNotificationInitialDelay()The initial delay (in ms.) before application sends first status update on event processors to Axon Server. Defaults to5000milliseconds.- Returns:
- The initial delay (in ms.) before application sends first status update on event processors to Axon Server.
-
setProcessorsNotificationInitialDelay
public void setProcessorsNotificationInitialDelay(int processorsNotificationInitialDelay) Sets the initial delay (in ms.) before application sends first status update on event processors to Axon Server. Defaults to5000milliseconds.- Parameters:
processorsNotificationInitialDelay- The initial delay (in ms.) before application sends first status update on event processors to Axon Server.
-
getKeepAliveTimeout
public long getKeepAliveTimeout()The timeout (in ms) for keep alive requests. Defaults to5000milliseconds.- Returns:
- The timeout (in ms) for keep alive requests.
-
setKeepAliveTimeout
public void setKeepAliveTimeout(long keepAliveTimeout) Sets the timeout (in ms) for keep alive requests. Defaults to5000milliseconds.- Parameters:
keepAliveTimeout- The timeout (in ms) for keep alive requests.
-
getKeepAliveTime
public long getKeepAliveTime()The interval (in ms) for keep alive requests, 0 is keep-alive disabled. Defaults to1000milliseconds.- Returns:
- The interval (in ms) for keep alive requests, 0 is keep-alive disabled.
-
setKeepAliveTime
public void setKeepAliveTime(long keepAliveTime) Sets the interval (in ms) for keep alive requests, 0 is keep-alive disabled. Defaults to1000milliseconds.- Parameters:
keepAliveTime- The interval (in ms) for keep alive requests, 0 is keep-alive disabled.
-
getSnapshotPrefetch
public int getSnapshotPrefetch()Anintindicating the maximum number of Aggregate snapshots which will be retrieved. Defaults to1.- Returns:
- An
intindicating the maximum number of Aggregate snapshots which will be retrieved.
-
setSnapshotPrefetch
public void setSnapshotPrefetch(int snapshotPrefetch) Sets the maximum number of Aggregate snapshots which will be retrieved. Defaults to1.- Parameters:
snapshotPrefetch- The maximum number of Aggregate snapshots which will be retrieved.
-
getSuppressDownloadMessage
Deprecated.Through use of the Axon Server Java Connector project, which enables the download message in absence of configured servers. -
setSuppressDownloadMessage
Deprecated.Through use of the Axon Server Java Connector project, which enables the download message in absence of configured servers. -
getMaxMessageSize
public int getMaxMessageSize()The gRPC max inbound message size. Defaults to0, keeping the default value from the connector.- Returns:
- The gRPC max inbound message size.
-
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize) Sets the gRPC max inbound message size. Defaults to0, keeping the default value from the connector.- Parameters:
maxMessageSize- The gRPC max inbound message size.
-
getMaxMessageSizeWarningThreshold
public double getMaxMessageSizeWarningThreshold()The threshold (in percentage of 0-1) of the max message size at which a warning should be logged. Defaults to0.8.- Returns:
- The threshold (in percentage of 0 to 1) of the max outbound message size at which a warning should be logged.
-
setMaxMessageSizeWarningThreshold
public void setMaxMessageSizeWarningThreshold(double maxMessageSizeWarningThreshold) The threshold (in percentage of 0-1) of the max message size at which a warning should be logged. Defaults to0.8.- Parameters:
maxMessageSizeWarningThreshold- The threshold (in percentage of 0 to 1) of the max outbound message size at which a warning should be logged.
-
getCommitTimeout
public int getCommitTimeout()The timeout (in milliseconds) to wait for response on commit. Defaults to10_000milliseconds.- Returns:
- The timeout (in milliseconds) to wait for response on commit.
-
setCommitTimeout
public void setCommitTimeout(int commitTimeout) Sets the timeout (in milliseconds) to wait for response on commit. Defaults to10_000milliseconds.- Parameters:
commitTimeout- The timeout (in milliseconds) to wait for response on commit.
-
isDisableEventBlacklisting
Deprecated.In favor ofsetEventBlockListingEnabled(boolean). -
setDisableEventBlacklisting
Deprecated.In favor ofsetEventBlockListingEnabled(boolean). -
isEventBlockListingEnabled
public boolean isEventBlockListingEnabled()Flag that allows block-listing of event types to be enabled.Disabling this may have serious performance impact, as it requires all
eventsfrom Axon Server to be sent to clients, even if a client is unable to process the event. Default is to have block-listing enabled.- Returns:
- Flag that allows block-listing of event types to be enabled.
-
setEventBlockListingEnabled
public void setEventBlockListingEnabled(boolean eventBlockListingEnabled) Sets flag that allows block-listing of event types to be enabled.Disabling this may have serious performance impact, as it requires all
eventsfrom Axon Server to be sent to clients, even if a client is unable to process the event. Default is to have block-listing enabled.- Parameters:
eventBlockListingEnabled- Flag that allows block-listing of event types to be enabled.
-
getMaxGrpcBufferedMessages
Deprecated.This property is no longer used through adjustments in the Axon Server Java Connector project. -
setMaxGrpcBufferedMessages
Deprecated.This property is no longer used through adjustments in the Axon Server Java Connector project. -
getCommandLoadFactor
public int getCommandLoadFactor()Anintrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured. The default value is100.- Returns:
- An
intrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured.
-
setCommandLoadFactor
public void setCommandLoadFactor(int commandLoadFactor) Sets anintrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured. The default value is100.- Parameters:
commandLoadFactor- Anintrepresenting the fixed value of load factor sent to Axon Server for any command's subscription if no specific implementation of CommandLoadFactorProvider is configured.
-
getConnectTimeout
public long getConnectTimeout()A value representing the maximum time in milliseconds a request for the initial Axon Server connection may last. Defaults to 5000 (5 seconds).- Returns:
- A value representing the maximum time in milliseconds a request for the initial Axon Server connection may last.
-
setConnectTimeout
public void setConnectTimeout(long connectTimeout) Sets the value representing the maximum time in milliseconds a request for the initial Axon Server connection may last. Defaults to 5000 (5 seconds).- Parameters:
connectTimeout- The value representing the maximum time in milliseconds a request for the initial Axon Server connection may last.
-
getReconnectInterval
public long getReconnectInterval()The amount of time in milliseconds to wait in between attempts to connect to Axon Server. A single attempt involves connecting to each of the configuredservers.Defaults to 2000 (2 seconds).
- Returns:
- The amount of time in milliseconds to wait in between attempts to connect to Axon Server.
-
setReconnectInterval
public void setReconnectInterval(long reconnectInterval) Sets the amount of time in milliseconds to wait in between attempts to connect to Axon Server. A single attempt involves connecting to each of the configuredservers.Defaults to 2000 (2 seconds).
- Parameters:
reconnectInterval- The amount of time in milliseconds to wait in between attempts to connect to Axon Server.
-
isForceReadFromLeader
public boolean isForceReadFromLeader()Indicates whether it is OK to query events from the local Axon Server node - the node the client is currently connected to. This means that the client will probably get stale events since all events my not be replicated to this node yet. Can be used when the criteria for eventual consistency is less strict. It will spread the load for querying events - not all requests will go to the leader of the cluster anymore.If Axon Server SE is used, this property has no effect.
- Returns:
- An indication whether it is OK to query events from the local Axon Server node - the node the client is currently connected to.
-
setForceReadFromLeader
public void setForceReadFromLeader(boolean forceReadFromLeader) Sets the indicator whether it is OK to query events from the local Axon Server node - the node the client is currently connected to. This means that the client will probably get stale events since all events my not be replicated to this node yet. Can be used when the criteria for eventual consistency is less strict. It will spread the load for querying events - not all requests will go to the leader of the cluster anymore.If Axon Server SE is used, this property has no effect.
- Parameters:
forceReadFromLeader- The indicator whether it is OK to query events from the local Axon Server node - the node the client is currently connected to.
-
isForceReconnectThroughServers
public boolean isForceReconnectThroughServers()Indicates whether theAxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.When
true(default), theAxonServerConnectionManagerwill contact the servers for a new destination each time a connection is dropped. Whenfalse, the connector will first attempt to re-establish a connection to the node it was previously connected to. When that fails, only then will it contact the servers.Default to
true, forcing the failed connection to be abandoned and a new one to be requested via the routing servers.- Returns:
- An indication whether the
AxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.
-
setForceReconnectThroughServers
public void setForceReconnectThroughServers(boolean forceReconnectThroughServers) Sets the indicator whether theAxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.When
true(default), theAxonServerConnectionManagerwill contact the servers for a new destination each time a connection is dropped. Whenfalse, the connector will first attempt to re-establish a connection to the node it was previously connected to. When that fails, only then will it contact the servers.Default to
true, forcing the failed connection to be abandoned and a new one to be requested via the routing servers.- Parameters:
forceReconnectThroughServers- The indicator whether theAxonServerConnectionManagershould always reconnect through theserversor try to reconnect with the server it just lost the connection with.
-
getConnectionManagementThreadPoolSize
public int getConnectionManagementThreadPoolSize()The number of threads that should be used for connection management activities by theAxonServerConnectionFactoryused by theAxonServerConnectionManager.This includes activities related to connecting to Axon Server, setting up instruction streams, sending and validating heartbeats, etc.
Defaults to a pool size of
2threads.- Returns:
- The number of threads that should be used for connection management activities by the
AxonServerConnectionFactoryused by theAxonServerConnectionManager.
-
setConnectionManagementThreadPoolSize
public void setConnectionManagementThreadPoolSize(int connectionManagementThreadPoolSize) Define the number of threads that should be used for connection management activities by theAxonServerConnectionFactoryused by theAxonServerConnectionManager.This includes activities related to connecting to Axon Server, setting up instruction streams, sending and validating heartbeats, etc.
Defaults to a pool size of
2threads.- Parameters:
connectionManagementThreadPoolSize- The number of threads that should be used for connection management activities by theAxonServerConnectionFactoryused by theAxonServerConnectionManager.
-
getHeartbeat
The configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.- Returns:
- The configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.
-
setHeartbeat
Sets the configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.- Parameters:
heartbeat- The configuration specifics on sending heartbeat messages to ensure a fully operational end-to-end connection with Axon Server.
-
getEventhandling
Return the configuredAxonServerConfiguration.Eventhandlingof this application for Axon Server.- Returns:
- The configured
AxonServerConfiguration.Eventhandlingof this application for Axon Server.
-
setEventhandling
Set theAxonServerConfiguration.Eventhandlingof this application for Axon Server- Parameters:
eventhandling- TheAxonServerConfiguration.Eventhandlingto set for this application.
-
getEventStoreConfiguration
@ConfigurationProperties(prefix="axon.axonserver.event-store") public AxonServerConfiguration.EventStoreConfiguration getEventStoreConfiguration()Return the configuredAxonServerConfiguration.EventStoreConfigurationof this application for Axon Server.- Returns:
- The configured
AxonServerConfiguration.EventStoreConfigurationof this application for Axon Server.
-
setEventStoreConfiguration
public void setEventStoreConfiguration(AxonServerConfiguration.EventStoreConfiguration eventStoreConfiguration) Set theAxonServerConfiguration.EventStoreConfigurationof this application for Axon Server- Parameters:
eventStoreConfiguration- TheAxonServerConfiguration.EventStoreConfigurationto set for this application.
-
getPersistentStreams
Returns the settings for each of the configured persistent streams, by name.- Returns:
- The settings for each of the configured persistent streams, by name.
-