Record Class ErrorContext
java.lang.Object
java.lang.Record
org.axonframework.messaging.eventhandling.processing.errorhandling.ErrorContext
- Record Components:
eventProcessor- The name of theEventProcessorthat failed to process the givenfailedEvents.error- The error that was raised during processing of thefailedEvents.failedEvents- The list of events that triggered the error.context- TheContextcarrying the resources that applied for the givenfailedEventswhen they were handled.
public record ErrorContext(@Nonnull String eventProcessor, @Nonnull Throwable error, @Nonnull List<? extends EventMessage> failedEvents, @Nonnull Context context)
extends Record
Describes the context of an error caught by an
EventProcessor
while processing a batch of events.- Since:
- 3.0.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionErrorContext(String eventProcessor, Throwable error, List<? extends EventMessage> failedEvents, Context context) Compact constructor of theErrorContextto validate theeventProcessor,error,failedEvents, andcontextare not null. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.Returns the value of theeventProcessorrecord component.List<? extends EventMessage> Returns the value of thefailedEventsrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ErrorContext
public ErrorContext(@Nonnull String eventProcessor, @Nonnull Throwable error, @Nonnull List<? extends EventMessage> failedEvents, @Nonnull Context context) Compact constructor of theErrorContextto validate theeventProcessor,error,failedEvents, andcontextare not null.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
eventProcessor
Returns the value of theeventProcessorrecord component.- Returns:
- the value of the
eventProcessorrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
failedEvents
Returns the value of thefailedEventsrecord component.- Returns:
- the value of the
failedEventsrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-