Class AxonServerConnectionManager.Builder
java.lang.Object
org.axonframework.axonserver.connector.AxonServerConnectionManager.Builder
- Enclosing class:
AxonServerConnectionManager
Builder class to instantiate an
AxonServerConnectionManager.
The routingServers default to "localhost:8024" and the
TagsConfiguration is defaulted to TagsConfiguration(). The
AxonServerConfiguration is a hard requirements and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaxonServerConfiguration(AxonServerConfiguration axonServerConfiguration) Sets theAxonServerConfigurationused to correctly configure connections between Axon clients and Axon Server.build()Initializes aAxonServerConnectionManageras specified through this Builder.channelCustomizer(UnaryOperator<io.grpc.ManagedChannelBuilder<?>> channelCustomization) Registers the givenchannelCustomization, which configures the underlingManagedChannelBuilderused to set up connections to AxonServer.routingServers(String routingServers) Comma separated list of Axon Server locations.tagsConfiguration(TagsConfiguration tagsConfiguration) Sets theTagsConfigurationused to add the tags of this Axon instance as client information when setting up a channel.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
routingServers
Comma separated list of Axon Server locations. Each element is hostname or hostname:grpcPort. Defaults to"localhost:8024".- Parameters:
routingServers- Comma separated list of Axon Server locations.- Returns:
- The current Builder instance, for fluent interfacing.
-
axonServerConfiguration
public AxonServerConnectionManager.Builder axonServerConfiguration(AxonServerConfiguration axonServerConfiguration) Sets theAxonServerConfigurationused to correctly configure connections between Axon clients and Axon Server.- Parameters:
axonServerConfiguration- anAxonServerConfigurationused to correctly configure the connections created by anAxonServerConnectionManagerinstance- Returns:
- the current Builder instance, for fluent interfacing
-
tagsConfiguration
Sets theTagsConfigurationused to add the tags of this Axon instance as client information when setting up a channel. Can for example be used to introduce labelling of your client applications for correct distribution in an Axon Server cluster. Defaults toTagsConfiguration(), thus an empty set of tags.- Parameters:
tagsConfiguration- aTagsConfigurationto add the tags of this Axon instance as client information when setting up a channel- Returns:
- the current Builder instance, for fluent interfacing
-
channelCustomizer
public AxonServerConnectionManager.Builder channelCustomizer(UnaryOperator<io.grpc.ManagedChannelBuilder<?>> channelCustomization) Registers the givenchannelCustomization, which configures the underlingManagedChannelBuilderused to set up connections to AxonServer.This method may be used in case none of the operations on this Builder provide support for the required feature.
- Parameters:
channelCustomization- A function defining the customization to make on the ManagedChannelBuilder- Returns:
- this builder for further configuration
-
build
Initializes aAxonServerConnectionManageras specified through this Builder.- Returns:
- a
AxonServerConnectionManageras specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-