Class DurableLocalCommandBusBuilder
- java.lang.Object
-
- dk.cloudcreate.essentials.components.foundation.reactive.command.DurableLocalCommandBusBuilder
-
public class DurableLocalCommandBusBuilder extends Object
Builder forDurableLocalCommandBus
-
-
Constructor Summary
Constructors Constructor Description DurableLocalCommandBusBuilder()
-
Method Summary
-
-
-
Method Detail
-
setDurableQueues
public DurableLocalCommandBusBuilder setDurableQueues(DurableQueues durableQueues)
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
-
setCommandQueueNameSelector
public DurableLocalCommandBusBuilder setCommandQueueNameSelector(CommandQueueNameSelector commandQueueNameSelector)
Set the strategy for selecting whichDurableQueuesQueueNameto use for a given combination of command and command handler
Defaults toCommandQueueRedeliveryPolicyResolver.sameReliveryPolicyForAllCommandQueues(RedeliveryPolicy)- Parameters:
commandQueueNameSelector- The strategy for selecting whichDurableQueuesQueueNameto use for a given combination of command and command handler- Returns:
- this builder instance
-
setCommandQueueRedeliveryPolicyResolver
public DurableLocalCommandBusBuilder setCommandQueueRedeliveryPolicyResolver(CommandQueueRedeliveryPolicyResolver commandQueueRedeliveryPolicyResolver)
Set the strategy that allows theDurableLocalCommandBusto vary theRedeliveryPolicyperQueueName
Defaults toCommandQueueNameSelector.defaultCommandQueueForAllCommands()withRedeliveryPolicy:RedeliveryPolicy.linearBackoff(Duration.ofMillis(150), Duration.ofMillis(1000), 20)- Parameters:
commandQueueRedeliveryPolicyResolver- The strategy that allows theDurableLocalCommandBusto vary theRedeliveryPolicyperQueueName- Returns:
- this builder instance
-
setSendAndDontWaitErrorHandler
public DurableLocalCommandBusBuilder setSendAndDontWaitErrorHandler(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<CommandBusInterceptor> interceptors)
Set all theCommandBusInterceptor's to use- Parameters:
interceptors- all theCommandBusInterceptor's to use- Returns:
- this builder instance
-
setInterceptors
public DurableLocalCommandBusBuilder setInterceptors(CommandBusInterceptor... interceptors)
Set all theCommandBusInterceptor's to use- Parameters:
interceptors- all theCommandBusInterceptor's to use- Returns:
- this builder instance
-
addInterceptors
public DurableLocalCommandBusBuilder addInterceptors(List<CommandBusInterceptor> interceptors)
Add additionalCommandBusInterceptor's to use- Parameters:
interceptors- the additionalCommandBusInterceptor's to use- Returns:
- this builder instance
-
addInterceptors
public DurableLocalCommandBusBuilder addInterceptors(CommandBusInterceptor... interceptors)
Add additionalCommandBusInterceptor's to use- Parameters:
interceptors- the additionalCommandBusInterceptor's to use- Returns:
- this builder instance
-
build
public DurableLocalCommandBus build()
-
-