public static class AxonServerConnectionManager.Builder extends Object
AxonServerConnectionManager.
The TagsConfiguration is defaulted to TagsConfiguration.TagsConfiguration() and the
ScheduledExecutorService defaults to an instance using a single thread with an AxonThreadFactory
tied to it. The Axon Framework version resolver (Supplier<String>) is defaulted to
AxonFrameworkVersionResolver. The AxonServerConfiguration is a hard requirements and as
such should be provided.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AxonServerConnectionManager.Builder |
axonFrameworkVersionResolver(Supplier<String> axonFrameworkVersionResolver)
Sets the Axon Framework version resolver used in order to communicate the client version to send to Axon
Server.
|
AxonServerConnectionManager.Builder |
axonServerConfiguration(AxonServerConfiguration axonServerConfiguration)
Sets the
AxonServerConfiguration used to correctly configure connections between Axon clients and
Axon Server. |
AxonServerConnectionManager |
build()
Initializes a
AxonServerConnectionManager as specified through this Builder. |
AxonServerConnectionManager.Builder |
instructionAckSource(InstructionAckSource<PlatformInboundInstruction> instructionAckSource)
Sets the instruction ack source used to send instruction acknowledgements.
|
AxonServerConnectionManager.Builder |
requestStreamFactory(Function<UpstreamAwareStreamObserver<PlatformOutboundInstruction>,io.grpc.stub.StreamObserver<PlatformInboundInstruction>> requestStreamFactory)
Sets the request stream factory that creates a request stream based on upstream.
|
AxonServerConnectionManager.Builder |
scheduler(ScheduledExecutorService scheduler)
Sets the
ScheduledExecutorService used to schedule connection attempts given certain success and/or
failure scenarios of a channel. |
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. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public AxonServerConnectionManager.Builder axonServerConfiguration(AxonServerConfiguration axonServerConfiguration)
AxonServerConfiguration used to correctly configure connections between Axon clients and
Axon Server.axonServerConfiguration - an AxonServerConfiguration used to correctly configure the connections
created by an AxonServerConnectionManager instancepublic AxonServerConnectionManager.Builder tagsConfiguration(TagsConfiguration tagsConfiguration)
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.TagsConfiguration(), thus an
empty set of tags.tagsConfiguration - a TagsConfiguration to add the tags of this Axon instance as client
information when setting up a channelpublic AxonServerConnectionManager.Builder scheduler(ScheduledExecutorService scheduler)
ScheduledExecutorService used to schedule connection attempts given certain success and/or
failure scenarios of a channel. Defaults to a ScheduledExecutorService with a single thread, using the
AxonThreadFactory to instantiate the threads.scheduler - a ScheduledExecutorService used to schedule connection attempts given certain
success and/or failure scenarios of a channelpublic AxonServerConnectionManager.Builder axonFrameworkVersionResolver(Supplier<String> axonFrameworkVersionResolver)
axonFrameworkVersionResolver - a string supplier that retrieve the current Axon Framework versionpublic AxonServerConnectionManager.Builder requestStreamFactory(Function<UpstreamAwareStreamObserver<PlatformOutboundInstruction>,io.grpc.stub.StreamObserver<PlatformInboundInstruction>> requestStreamFactory)
UpstreamAwareStreamObserver.getRequestStream().requestStreamFactory - factory that creates a request stream based on upstreampublic AxonServerConnectionManager.Builder instructionAckSource(InstructionAckSource<PlatformInboundInstruction> instructionAckSource)
DefaultInstructionAckSource.instructionAckSource - used to send instruction acknowledgementspublic AxonServerConnectionManager build()
AxonServerConnectionManager as specified through this Builder.AxonServerConnectionManager as specified through this Builderprotected void validate()
throws AxonConfigurationException
AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2020. All rights reserved.