Package org.axonframework.test.deadline
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.
Functional interface describing a
Consumer of a DeadlineMessage.- Since:
- 3.3
- Author:
- Milan Savic, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(ScopeDescriptor deadlineScope, DeadlineMessage deadlineMessage) Consumes givendeadlineMessage.default voidconsume(ScopeDescriptor deadlineScope, DeadlineMessage deadlineMessage, ProcessingContext context) Consumes givendeadlineMessagewithin the givencontext, theProcessingContextof the unit of work theStubDeadlineManagerfires the deadline in.
-
Method Details
-
consume
Consumes givendeadlineMessage. ThedeadlineScopeis used to identify the exact handler of the message.- Parameters:
deadlineScope- a description of theScopein which a deadline was scheduleddeadlineMessage- theDeadlineMessageto be handled- Throws:
Exception- in case something goes wrong while consuming thedeadlineMessage
-
consume
default void consume(ScopeDescriptor deadlineScope, DeadlineMessage deadlineMessage, ProcessingContext context) throws Exception Consumes givendeadlineMessagewithin the givencontext, theProcessingContextof the unit of work theStubDeadlineManagerfires the deadline in.This is the method the
StubDeadlineManagerinvokes. It defaults toconsume(ScopeDescriptor, DeadlineMessage), so a consumer written for Axon Framework 4 keeps working. A consumer that hands the deadline to aScopeAwarecomponent overrides it, asScopeAware#sendneeds 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 theScopein which a deadline was scheduleddeadlineMessage- theDeadlineMessageto be handledcontext- the context of the unit of work the deadline is fired in- Throws:
Exception- in case something goes wrong while consuming thedeadlineMessage
-