Interface DeadlineConsumer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DeadlineConsumer
Functional interface describing a Consumer of a DeadlineMessage.
Since:
3.3
Author:
Milan Savic, Steven van Beelen
  • Method Details

    • consume

      void consume(ScopeDescriptor deadlineScope, DeadlineMessage deadlineMessage) throws Exception
      Consumes given deadlineMessage. The deadlineScope is used to identify the exact handler of the message.
      Parameters:
      deadlineScope - a description of the Scope in which a deadline was scheduled
      deadlineMessage - the DeadlineMessage to be handled
      Throws:
      Exception - in case something goes wrong while consuming the deadlineMessage
    • consume

      default void consume(ScopeDescriptor deadlineScope, DeadlineMessage deadlineMessage, ProcessingContext context) throws Exception
      Consumes given deadlineMessage within the given context, the ProcessingContext of the unit of work the StubDeadlineManager fires the deadline in.

      This is the method the StubDeadlineManager invokes. It defaults to consume(ScopeDescriptor, DeadlineMessage), so a consumer written for Axon Framework 4 keeps working. A consumer that hands the deadline to a ScopeAware component overrides it, as ScopeAware#send needs that context. Axon Framework 4 found the unit of work in a thread-local instead, which Axon Framework 5 no longer has.

      Parameters:
      deadlineScope - a description of the Scope in which a deadline was scheduled
      deadlineMessage - the DeadlineMessage to be handled
      context - the context of the unit of work the deadline is fired in
      Throws:
      Exception - in case something goes wrong while consuming the deadlineMessage