Access Mule Message from arbitrary place in a thread

♀尐吖头ヾ 提交于 2019-12-14 02:25:17

问题


With Mule ESB, from an arbitrary class, is it possible to get a handle of the current mule message for that thread? For example, if I create custom log4j appender, can it get access to the mule message and pull data from it?


回答1:


Yes, by using RequestContext.getEvent().getMessage() (javadoc).

And yes, it is deprecated, with this warning:

If access to MuleEvent or MuleMessage is required, then implement a MessageProcessor or Callable instead

But this is not always possible. So using this static helper remains your best option.



来源:https://stackoverflow.com/questions/27976893/access-mule-message-from-arbitrary-place-in-a-thread

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