Class AxonServerConnectionManager.Builder

java.lang.Object
org.axonframework.axonserver.connector.AxonServerConnectionManager.Builder
Enclosing class:
AxonServerConnectionManager

public static class AxonServerConnectionManager.Builder extends Object
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 Details

    • Builder

      public Builder()
  • Method Details

    • routingServers

      public AxonServerConnectionManager.Builder routingServers(String 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 the AxonServerConfiguration used to correctly configure connections between Axon clients and Axon Server.
      Parameters:
      axonServerConfiguration - an AxonServerConfiguration used to correctly configure the connections created by an AxonServerConnectionManager instance
      Returns:
      the current Builder instance, for fluent interfacing
    • tagsConfiguration

      public AxonServerConnectionManager.Builder tagsConfiguration(TagsConfiguration tagsConfiguration)
      Sets the TagsConfiguration used 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 to TagsConfiguration(), thus an empty set of tags.
      Parameters:
      tagsConfiguration - a TagsConfiguration to 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 given channelCustomization, which configures the underling ManagedChannelBuilder used 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 a AxonServerConnectionManager as specified through this Builder.
      Returns:
      a AxonServerConnectionManager as specified through this Builder
    • validate

      protected void validate() throws AxonConfigurationException
      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