How to implement a Mule Message Observer?

你说的曾经没有我的故事 提交于 2019-12-23 06:04:06

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/13361727/how-to-implement-a-mule-message-observer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!