public static class SimpleQueryBus.Builder extends Object
SimpleQueryBus
.
The MessageMonitor
is defaulted to NoOpMessageMonitor
, TransactionManager
to
NoTransactionManager
, QueryInvocationErrorHandler
to LoggingQueryInvocationErrorHandler
,
the QueryUpdateEmitter
to SimpleQueryUpdateEmitter
and the SpanFactory
defaults to a
NoOpSpanFactory
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SimpleQueryBus |
build()
Initializes a
SimpleQueryBus as specified through this Builder. |
SimpleQueryBus.Builder |
duplicateQueryHandlerResolver(DuplicateQueryHandlerResolver duplicateQueryHandlerResolver)
Sets the duplicate query handler resolver.
|
SimpleQueryBus.Builder |
errorHandler(QueryInvocationErrorHandler errorHandler)
Sets the
QueryInvocationErrorHandler to handle exceptions during query handler invocation. |
SimpleQueryBus.Builder |
messageMonitor(MessageMonitor<? super QueryMessage<?,?>> messageMonitor)
Sets the
MessageMonitor used to monitor query messages. |
SimpleQueryBus.Builder |
queryUpdateEmitter(QueryUpdateEmitter queryUpdateEmitter)
Sets the
QueryUpdateEmitter used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage) . |
SimpleQueryBus.Builder |
spanFactory(SpanFactory spanFactory)
Sets the
SpanFactory implementation to use for providing tracing capabilities. |
SimpleQueryBus.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage the query handling transactions. |
protected void |
validate()
Validate whether the fields contained in this Builder are set accordingly.
|
public SimpleQueryBus.Builder messageMonitor(@Nonnull MessageMonitor<? super QueryMessage<?,?>> messageMonitor)
MessageMonitor
used to monitor query messages. Defaults to a NoOpMessageMonitor
.messageMonitor
- a MessageMonitor
used to monitor query messagespublic SimpleQueryBus.Builder duplicateQueryHandlerResolver(DuplicateQueryHandlerResolver duplicateQueryHandlerResolver)
DuplicateQueryHandlerResolution
contains good examples on this and will most of the time suffice. The
bus defaults to DuplicateQueryHandlerResolution.logAndAccept()
.
duplicateQueryHandlerResolver
- The DuplicateQueryHandlerResolver to use when multiple
registrations are detectedpublic SimpleQueryBus.Builder transactionManager(@Nonnull TransactionManager transactionManager)
TransactionManager
used to manage the query handling transactions. Defaults to a
NoTransactionManager
.transactionManager
- a TransactionManager
used to manage the query handling transactionspublic SimpleQueryBus.Builder errorHandler(@Nonnull QueryInvocationErrorHandler errorHandler)
QueryInvocationErrorHandler
to handle exceptions during query handler invocation. Defaults
to a LoggingQueryInvocationErrorHandler
using this instance it's Logger
.errorHandler
- a QueryInvocationErrorHandler
to handle exceptions during query handler
invocationpublic SimpleQueryBus.Builder queryUpdateEmitter(@Nonnull QueryUpdateEmitter queryUpdateEmitter)
QueryUpdateEmitter
used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage)
. Defaults to a
SimpleQueryUpdateEmitter
.queryUpdateEmitter
- the QueryUpdateEmitter
used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage)
public SimpleQueryBus.Builder spanFactory(@Nonnull SpanFactory spanFactory)
SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementationpublic SimpleQueryBus build()
SimpleQueryBus
as specified through this Builder.SimpleQueryBus
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–2023. All rights reserved.