Class DurableLocalCommandBus

    • Field Detail

      • DEFAULT_COMMAND_QUEUE_NAME

        public static final QueueName DEFAULT_COMMAND_QUEUE_NAME
      • DEFAULT_REDELIVERY_POLICY

        public static final RedeliveryPolicy DEFAULT_REDELIVERY_POLICY
    • Constructor Detail

      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      QueueName commandQueueName,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler)
        Create a new DurableLocalCommandBus using defaults:
        • SendAndDontWaitErrorHandler: SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
        Parameters:
        durableQueues - the underlying Durable Queues provider
        commandQueueName - Set the name of the DurableQueues that will be used queuing commands sent using sendAndDontWait(Object)
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler,
                                      List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors)
        Parameters:
        durableQueues - the underlying Durable Queues provider
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
        interceptors - all the CommandBusInterceptor's
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      int parallelSendAndDontWaitConsumers,
                                      QueueName commandQueueName,
                                      RedeliveryPolicy commandQueueRedeliveryPolicy,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler,
                                      List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors)
        Parameters:
        durableQueues - the underlying Durable Queues provider
        parallelSendAndDontWaitConsumers - How many parallel DurableQueues consumers should listen for messages added using sendAndDontWait(Object)/sendAndDontWait(Object, Duration)
        commandQueueName - Set the name of the DurableQueues that will be used queuing commands sent using sendAndDontWait(Object)
        commandQueueRedeliveryPolicy - Set the RedeliveryPolicy used when handling queued commnds sent usingsendAndDontWait(Object)
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
        interceptors - all the CommandBusInterceptor's
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      QueueName commandQueueName,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler,
                                      List<dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor> interceptors)
        Parameters:
        durableQueues - the underlying Durable Queues provider
        commandQueueName - {The strategy for selecting which DurableQueues QueueName to use for a given combination of command and command handler
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
        interceptors - all the CommandBusInterceptor's
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      QueueName commandQueueName,
                                      dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors)
        Create a new DurableLocalCommandBus using defaults:
        Parameters:
        durableQueues - the underlying Durable Queues provider
        commandQueueName - {The strategy for selecting which DurableQueues QueueName to use for a given combination of command and command handler
        interceptors - all the CommandBusInterceptor's
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler,
                                      dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors)
        Parameters:
        durableQueues - the underlying Durable Queues provider
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
        interceptors - all the CommandBusInterceptor's
      • DurableLocalCommandBus

        public DurableLocalCommandBus​(DurableQueues durableQueues,
                                      int parallelSendAndDontWaitConsumers,
                                      QueueName commandQueueName,
                                      RedeliveryPolicy commandQueueRedeliveryPolicy,
                                      dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler sendAndDontWaitErrorHandler,
                                      dk.cloudcreate.essentials.reactive.command.interceptor.CommandBusInterceptor... interceptors)
        Parameters:
        durableQueues - the underlying Durable Queues provider
        parallelSendAndDontWaitConsumers - How many parallel DurableQueues consumers should listen for messages added using sendAndDontWait(Object)/sendAndDontWait(Object, Duration)
        commandQueueName - Set the name of the DurableQueues that will be used queuing commands sent using sendAndDontWait(Object)
        commandQueueRedeliveryPolicy - Set the RedeliveryPolicy used when handling queued commnds sent usingsendAndDontWait(Object)
        sendAndDontWaitErrorHandler - Exception handler that will handle errors that occur during CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration). If this handler doesn't rethrow the exeption, then the message will not be retried by the underlying DurableQueues
        interceptors - all the CommandBusInterceptor's
    • Method Detail

      • start

        public void start()
        Description copied from interface: Lifecycle
        Start the processing. This operation must be idempotent, such that duplicate calls to Lifecycle.start() for an already started process (where Lifecycle.isStarted() returns true) is ignored
        Specified by:
        start in interface Lifecycle
      • stop

        public void stop()
        Description copied from interface: Lifecycle
        Stop the processing. This operation must be idempotent, such that duplicate calls to Lifecycle.stop() for an already stopped process (where Lifecycle.isStarted() returns false) is ignored
        Specified by:
        stop in interface Lifecycle
      • isStarted

        public boolean isStarted()
        Description copied from interface: Lifecycle
        Returns true if the process is started
        Specified by:
        isStarted in interface Lifecycle
        Returns:
        true if the process is started otherwise false
      • sendAndDontWait

        public <C> void sendAndDontWait​(C command)
        Specified by:
        sendAndDontWait in interface dk.cloudcreate.essentials.reactive.command.CommandBus
      • sendAndDontWait

        public <C> void sendAndDontWait​(C command,
                                        Duration delayMessageDelivery)
        Specified by:
        sendAndDontWait in interface dk.cloudcreate.essentials.reactive.command.CommandBus
      • getParallelSendAndDontWaitConsumers

        public int getParallelSendAndDontWaitConsumers()
      • getCommandQueueName

        public QueueName getCommandQueueName()
      • getCommandQueueRedeliveryPolicy

        public RedeliveryPolicy getCommandQueueRedeliveryPolicy()