Class InternalOMRSEventProcessingContext
java.lang.Object
org.odpi.openmetadata.repositoryservices.connectors.omrstopic.InternalOMRSEventProcessingContext
Internal Asynchronous message processing context. This class allows egeria to be notified when a message is being
processed asynchronously so that the consumer can correctly record when the message has been
completely processed. This class is not considered part of the Egeria public
API and may change without notice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAsyncProcessingResult
(Future<?> future) Registers aFuture
associated with asynchronous message processing.void
addAsyncProcessingResult
(OMRSFuture future) Registers anOMRSFuture
associated with asynchronous message processing.static void
clear()
Clears theInternalOMRSEventProcessingContext
for the current thread.Gets the unique identifier for the current message that is being processed.Gets the thread-localInternalOMRSEventProcessingContext
instance for the current thread.Gets the overall asynchronous processing result from all consumers.void
setCurrentMessageId
(String messageId) Sets the unique identifier for the current message that is being processed.
-
Constructor Details
-
InternalOMRSEventProcessingContext
public InternalOMRSEventProcessingContext()
-
-
Method Details
-
addAsyncProcessingResult
Registers aFuture
associated with asynchronous message processing.- Parameters:
future
- registered object
-
addAsyncProcessingResult
Registers anOMRSFuture
associated with asynchronous message processing.- Parameters:
future
- registered object
-
getOverallAsyncProcessingResult
Gets the overall asynchronous processing result from all consumers. This method is guaranteed to return a non-null result. If there is no asynchronous processing happening, an instance ofCompletedFuture
will be returned, indicating that asynchronous processing has finished- Returns:
- the overall processing result
-
getInstance
Gets the thread-localInternalOMRSEventProcessingContext
instance for the current thread.- Returns:
- the instance of
InternalOMRSEventProcessingContext
for the current thread
-
clear
public static void clear()Clears theInternalOMRSEventProcessingContext
for the current thread. -
getCurrentMessageId
Gets the unique identifier for the current message that is being processed.- Returns:
- the current message id
-
setCurrentMessageId
Sets the unique identifier for the current message that is being processed.- Parameters:
messageId
- The messageId to set
-