Class DurableLocalCommandBusBuilder
java.lang.Object
dk.cloudcreate.essentials.components.foundation.reactive.command.DurableLocalCommandBusBuilder
Builder for
DurableLocalCommandBus-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInterceptors(dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors) Add additionalCommandBusInterceptor's to useaddInterceptors(List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors) Add additionalCommandBusInterceptor's to usebuild()setCommandQueueName(QueueName commandQueueName) Set the name of theDurableQueuesthat will be used queuing commands sent usingDurableLocalCommandBus.sendAndDontWait(Object)
Defaults toDurableLocalCommandBus.DEFAULT_COMMAND_QUEUE_NAMEsetCommandQueueRedeliveryPolicy(RedeliveryPolicy commandQueueRedeliveryPolicy) Set theRedeliveryPolicyused when handling queued commands sent usingDurableLocalCommandBus.sendAndDontWait(Object)Defaults toDurableLocalCommandBus.DEFAULT_REDELIVERY_POLICY.
Example:setDurableQueues(DurableQueues durableQueues) Set the underlying Durable Queues providersetInterceptors(dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors) Set all theCommandBusInterceptor's to usesetInterceptors(List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors) Set all theCommandBusInterceptor's to usesetParallelSendAndDontWaitConsumers(int parallelSendAndDontWaitConsumers) Set how many parallelDurableQueuesconsumers should listen for messages added usingCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)
Defaults to 10setSendAndDontWaitErrorHandler(dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler) Set the Exception handler that will handle errors that occur duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration).
-
Constructor Details
-
DurableLocalCommandBusBuilder
public DurableLocalCommandBusBuilder()
-
-
Method Details
-
setDurableQueues
Set the underlying Durable Queues provider- Parameters:
durableQueues- the underlying Durable Queues provider- Returns:
- this builder instance
-
setParallelSendAndDontWaitConsumers
public DurableLocalCommandBusBuilder setParallelSendAndDontWaitConsumers(int parallelSendAndDontWaitConsumers) Set how many parallelDurableQueuesconsumers should listen for messages added usingCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)
Defaults to 10- Parameters:
parallelSendAndDontWaitConsumers- How many parallelDurableQueuesconsumers should listen for messages added usingCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)- Returns:
- this builder instance
-
setCommandQueueName
Set the name of theDurableQueuesthat will be used queuing commands sent usingDurableLocalCommandBus.sendAndDontWait(Object)
Defaults toDurableLocalCommandBus.DEFAULT_COMMAND_QUEUE_NAME- Parameters:
commandQueueName- Set the name of theDurableQueuesthat will be used to store asynchronous commands sent usingDurableLocalCommandBus.sendAndDontWait(Object)- Returns:
- this builder instance
-
setCommandQueueRedeliveryPolicy
public DurableLocalCommandBusBuilder setCommandQueueRedeliveryPolicy(RedeliveryPolicy commandQueueRedeliveryPolicy) Set theRedeliveryPolicyused when handling queued commands sent usingDurableLocalCommandBus.sendAndDontWait(Object)Defaults toDurableLocalCommandBus.DEFAULT_REDELIVERY_POLICY.
Example:RedeliveryPolicy.linearBackoff(Duration.ofMillis(150), Duration.ofMillis(1000), 20)- Parameters:
commandQueueRedeliveryPolicy- The strategy that allows theDurableLocalCommandBusto vary theRedeliveryPolicyperQueueName- Returns:
- this builder instance
-
setSendAndDontWaitErrorHandler
public DurableLocalCommandBusBuilder setSendAndDontWaitErrorHandler(dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler) Set the Exception handler that will handle errors that occur duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlyingDurableQueues- Parameters:
sendAndDontWaitErrorHandler- The Exception handler that will handle errors that occur duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlyingDurableQueues- Returns:
- this builder instance
-
setInterceptors
public DurableLocalCommandBusBuilder setInterceptors(List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors) Set all theCommandBusInterceptor's to use- Parameters:
interceptors- all theCommandBusInterceptor's to use- Returns:
- this builder instance
-
setInterceptors
public DurableLocalCommandBusBuilder setInterceptors(dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors) Set all theCommandBusInterceptor's to use- Parameters:
interceptors- all theCommandBusInterceptor's to use- Returns:
- this builder instance
-
addInterceptors
public DurableLocalCommandBusBuilder addInterceptors(List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors) Add additionalCommandBusInterceptor's to use- Parameters:
interceptors- the additionalCommandBusInterceptor's to use- Returns:
- this builder instance
-
addInterceptors
public DurableLocalCommandBusBuilder addInterceptors(dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors) Add additionalCommandBusInterceptor's to use- Parameters:
interceptors- the additionalCommandBusInterceptor's to use- Returns:
- this builder instance
-
build
-