Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MuleEvent event.getFlowVariable vs.event.getMessage().getInvocationProperty_Mule - Fatal编程技术网

MuleEvent event.getFlowVariable vs.event.getMessage().getInvocationProperty

MuleEvent event.getFlowVariable vs.event.getMessage().getInvocationProperty,mule,Mule,对于传递给MessageProcessor的MuleEvent事件:event.getFlowVariable与event.getMessage().getInvocationProperty之间的区别是什么。我进行了测试,即使对于async,它们也给出了相同的结果(我通过在具有不同变量值的分散聚集中调用它进行了测试)基本上没有任何差异。事实上,当设置消息时,消息级名为invocationProperty的flowVariables会复制到mule事件中,以便您也可以通过getFlowVaria

对于传递给
MessageProcessor
MuleEvent事件
event.getFlowVariable
event.getMessage().getInvocationProperty
之间的区别是什么。我进行了测试,即使对于async,它们也给出了相同的结果(我通过在具有不同变量值的分散聚集中调用它进行了测试)

基本上没有任何差异。事实上,当设置消息时,消息级名为invocationProperty的flowVariables会复制到mule事件中,以便您也可以通过getFlowVariable方法从那里访问它。 这是MuleDefaultEvent.class setMessage方法的摘录,该方法显示值完全相同

@Override
public void setMessage(MuleMessage message)
{
    this.message = message;
    if (message instanceof DefaultMuleMessage)
    {
        // Don't copy properties from message to event every time we copy event as we did before. Rather
        // only copy invocation properties over if MuleMessage had invocation properties set on it before
        // MuleEvent was created.
        flowVariables.putAll(((DefaultMuleMessage) message).getOrphanFlowVariables());

        ((DefaultMuleMessage) message).setInvocationProperties(flowVariables);
        if (session instanceof DefaultMuleSession)
        {
            ((DefaultMuleMessage) message).setSessionProperties(((DefaultMuleSession) session).getProperties());
        }
    }
}
希望这有帮助。
问候

谢谢你的摘录。我很高兴他们的价值观基本相同。你能追踪到那些代码真是太棒了。欢迎你。我只是利用了Eclipse/anypointstudio快捷键ctrl+shift+T(Open-Type)并键入了DefaultMuleEvent之类的类名。一旦你能够阅读这些资料,一切都变得容易了。当然不适用于企业库:-)