Package com.technia.tif.enovia.messaging
Interface MessageContext<T>
- All Known Subinterfaces:
KafkaMessageContext
- All Known Implementing Classes:
MessageContextBase
@API
public interface MessageContext<T>
Provides contextual information for a message received from a messaging
system and access to the
Exception that occurred during message
processing. It encapsulates both the message being processed and the
associated failure.- Since:
- 2026.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordPost-processing context associated with a completed job. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets a callback that is invoked when message processing is complete.Returns the exception that occurred during message processing.Returns the message associated with the current delivery.Returns a creator for creating new child job.Attempts to resolve the content of the underlying message as text.
-
Method Details
-
getMessage
T getMessage()Returns the message associated with the current delivery.- Returns:
- the received message
-
resolveMessageText
Attempts to resolve the content of the underlying message as text.The implementation may inspect the message type and apply appropriate conversion logic in order to produce a textual representation of the message payload.
If the message content cannot be resolved or meaningfully represented as text, this method returns
null. -
getException
Exception getException()Returns the exception that occurred during message processing. Only present when an exception has occurred.- Returns:
- the exception associated with the failure, or null
-
newChildJob
JobCreator newChildJob()Returns a creator for creating new child job.- Returns:
- the creator
-
afterComplete
Sets a callback that is invoked when message processing is complete.The callback is typically executed after the message has been handled. It may be used to perform post-processing actions after the associated job is persisted into the TIF database.
- Parameters:
callback- the callback to invoke when message processing is complete
-