Question

Im trying to implement a simple message observer on Mule that don't need to mutate the message.

This link on the documentation says that the easiest way is to extend the AbstractMessageObserver. But as i can see on this link the class has been removed in the earlier versions of Mule.

So, the best way to do this now is implementing the MessageProcessor interface and simply return the MuleEvent param in the process method?

Was it helpful?

Solution

If you need to access the whole MuleEvent, either a MessageProcessor or a POJO that implements Callable.

Otherwise, if you only need to observe the payload a simple POJO component would do the trick.

Note that Mule also offers interceptors (and InterceptingMessageProcessors): use an interceptor if you need to run before/after actions or if you want the possibility to stop processing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top