public interface EventContext
Event created as part of
the processing of the source message will maintain a reference to this instance. Wherever a Flow references another Flow this
EventContext will be maintained, while whenever there is a connector boundary a new instance will be created by the
receiving source.Event| Modifier and Type | Method and Description |
|---|---|
void |
error(Throwable throwable)
Complete this
EventContext unsuccessfully with an error |
org.reactivestreams.Publisher<Event> |
getBeforeResponsePublisher()
A
Publisher that completes when a response is ready or an error was produced for this EventContext but
importantly before the Response Publisher obtained via getResponsePublisher() completes. |
org.reactivestreams.Publisher<Void> |
getCompletionPublisher()
|
String |
getCorrelationId()
The correlation ID is used to correlate messages between different flows and systems.
|
String |
getId()
Unique time-based id (UUID) for this
EventContext. |
String |
getOriginatingConnectorName() |
String |
getOriginatingFlowName() |
org.mule.runtime.api.component.location.ComponentLocation |
getOriginatingLocation() |
String |
getOriginatingSourceName() |
Optional<EventContext> |
getParentContext()
Returns
this context's parent if it has one |
ProcessingTime |
getProcessingTime() |
ProcessorsTrace |
getProcessorsTrace()
Events have a list of message processor paths it went trough so that the execution path of an event can be reconstructed
after it has executed.
|
OffsetTime |
getReceivedTime() |
org.reactivestreams.Publisher<Event> |
getResponsePublisher()
A
Publisher that completes when a response is ready or an error was produced for this EventContext. |
boolean |
isCorrelationIdFromSource()
Used to determine if the correlation was set by the source connector or was generated.
|
void |
success()
Complete this
EventContext successfully with no result Event. |
void |
success(Event event)
Complete this
EventContext successfully with a result Event. |
String getId()
EventContext.EventContextString getCorrelationId()
If the connector that receives the source message supports the concept of a correlation ID then the connector should create
an instance of EventContext using this value. If on the other hand, no correlation ID is received by the source
connector then a time-based UUID, also available via getId() is used.
OffsetTime getReceivedTime()
org.mule.runtime.api.component.location.ComponentLocation getOriginatingLocation()
String getOriginatingFlowName()
String getOriginatingConnectorName()
String getOriginatingSourceName()
void success()
EventContext successfully with no result Event.void success(Event event)
EventContext successfully with a result Event.event - the result event.void error(Throwable throwable)
EventContext unsuccessfully with an errorthrowable - the throwable.ProcessingTime getProcessingTime()
ProcessorsTrace getProcessorsTrace()
DefaultMuleConfiguration.isFlowTrace() is true. If false, the list will
always be empty.boolean isCorrelationIdFromSource()
true if the source system provided a correlation id, false otherwise.Optional<EventContext> getParentContext()
this context's parent if it has onethis context's parent or Optional.empty() if it doesn't have oneorg.reactivestreams.Publisher<Event> getBeforeResponsePublisher()
Publisher that completes when a response is ready or an error was produced for this EventContext but
importantly before the Response Publisher obtained via getResponsePublisher() completes. This allows for
response subscribers that are executed before the source, client or parent flow receives to be registered. In order to
subscribe after response processing you can use the response Publisher.
Any asynchronous processing initiated as part of processing the request Event maybe still be in process when this
Publisher completes. The completion Publisher can be used to perform an action after all processing is
complete.EventContext instance has a response of error.getResponsePublisher(),
getCompletionPublisher()org.reactivestreams.Publisher<Event> getResponsePublisher()
Publisher that completes when a response is ready or an error was produced for this EventContext.
Any subscribers registered before the response completes will be executed after the response has been processed by the
source, client or parent flow. In order to subscribe before response processing you can use the before response
Publisher.
Any asynchronous processing initiated as part of processing the request Event maybe still be in process when this
Publisher completes. The completion Publisher can be used to perform an action after all processing is
complete.EventContext instance has a response of error.(),
getCompletionPublisher()org.reactivestreams.Publisher<Void> getCompletionPublisher()
Publisher that completes when a this EventContext and all child EventContext's have
completed. In practice this means that this Publisher completes once all branches of execution have completed
regardless of is they are synchronous or asynchronous. This Publisher will never complete with an error.EventContext and all child context have completed.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.