public abstract class AbstractRequestResponseMessageProcessor extends AbstractInterceptingMessageProcessor
Processor that may performs processing during both the
request and response processing phases while supporting non-blocking execution.
In order to define the process during the request phase you should override the
processRequest(org.mule.runtime.core.api.Event) method. Symmetrically, if you need to define a process to be executed
during the response phase, then you should override the processResponse(Event) method.
In some cases you'll have some code that should be always executed, even if an error occurs, for those cases you should
override the processFinally(org.mule.runtime.core.api.Event, MessagingException) method.
ReactiveProcessor.ProcessingTypeflowConstruct, logger, muleContext, next| Constructor and Description |
|---|
AbstractRequestResponseMessageProcessor() |
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<Event> |
apply(org.reactivestreams.Publisher<Event> publisher)
Applies a
Publisher function transforming a stream of Event's. |
Event |
process(Event event)
Invokes the MessageProcessor.
|
protected Event |
processCatch(Event event,
MessagingException exception) |
protected void |
processFinally(Event event,
MessagingException exception)
Used to perform post processing after both request and response phases have been completed.
|
protected ReactiveProcessor |
processRequest()
Processes the request phase before the next message processor is invoked.
|
protected Event |
processRequest(Event request)
Processes the request phase before the next message processor is invoked.
|
protected ReactiveProcessor |
processResponse()
Processes the response phase after the next message processor and it's response phase have been invoked
|
protected Event |
processResponse(Event response)
Processes the response phase after the next message processor and it's response phase have been invoked
|
applyNext, getListener, getMuleContext, isEventValid, processNext, setFlowConstruct, setListener, setMuleContext, toStringgetAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetListenergetProcessingTypepublic AbstractRequestResponseMessageProcessor()
public Event process(Event event) throws org.mule.runtime.api.exception.MuleException
Processorevent - MuleEvent to be processedorg.mule.runtime.api.exception.MuleExceptionpublic org.reactivestreams.Publisher<Event> apply(org.reactivestreams.Publisher<Event> publisher)
ProcessorPublisher function transforming a stream of Event's.
The default implementation delegates to Processor.process(Event) and will:
Processor.process(Event) returns null.publisher - the event stream to transformprotected Event processRequest(Event request) throws org.mule.runtime.api.exception.MuleException
request - event to be processed.org.mule.runtime.api.exception.MuleException - exception thrown by implementations of this method whiile performing response processingprotected ReactiveProcessor processRequest()
protected Event processResponse(Event response) throws org.mule.runtime.api.exception.MuleException
response - response event to be processed.org.mule.runtime.api.exception.MuleException - exception thrown by implementations of this method whiile performing response processingprotected ReactiveProcessor processResponse()
protected void processFinally(Event event, MessagingException exception)
event - the result of request and response processing. Note that this includes the request and response processing of
the rest of the Flow following this message processor too.exception - the exception thrown during processing if any. If not exception was thrown then this parameter is nullprotected Event processCatch(Event event, MessagingException exception) throws MessagingException
MessagingExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.