有没有办法抑制Mule的(3.3.1)catch-exception-strategy行为记录组件的特定实例的整个堆栈跟踪?我不想在类的log4j配置中这样做,因为我想要记录意外的异常.
我希望能够在流程中捕获异常并决定是否记录它(并吓跑操作团队)或者只是采取纠正措施并继续前进.在下面,是否有一些方法可以将第一个实例配置为不记录堆栈跟踪?
<choice-exception-strategy>
<catch-exception-strategy when="exception.causedBy(my.exception.SpecificException)">
<!-- I don't want logging on this one -->
</catch-exception-strategy>
<catch-exception-strategy>
<!-- I do want it here -->
</catch-exception-strategy>
</choice-exception-strategy>
Run Code Online (Sandbox Code Playgroud) 我在这里做错了什么?我想将 Mule 消息的有效负载设置为包含多个值的映射,其中之一是流变量的内容。
<set-variable variableName="myVariable" value="foo"/>
<set-payload value="#[['STATUS':'OKAY','NEXT':'Test','TEXT':flowVars['myVariable']]]"/>
<logger level="INFO" message="#[payload]"/>
Run Code Online (Sandbox Code Playgroud)
其输出是:
{STATUS=OKAY, NEXT=Test}
Run Code Online (Sandbox Code Playgroud)
我期待着:
{STATUS=OKAY, NEXT=Test, TEXT=foo}
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用一系列表达式转换器来做到这一点,但是,如果我想使用这种表示法,为什么它不提取流变量的值呢?
编辑:删除源代码中的拼写错误 这解决了 Ryan 在下面的答案中指出的问题。