批处理Mule esb中的面向错误 [英] Facing error in Batch Processing mule esb

查看:81
本文介绍了批处理Mule esb中的面向错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在批量处理Mule esb时遇到问题.如果我在过程记录面上设置任何有效负载,并尝试以不完整的方式获得该有效负载,则无法获得该有效负载.变量和属性也有同样的问题. 如果我在流程记录阶段设置了任何属性,并尝试进入完成阶段,那么总会得到null值. 在未完成阶段如何获得这些价值? 下面是流程.

I am facing problem in batch processing mule esb. If I set any payload in process record face and try to get that payload in oncomplete face then not getting that payload. same problem with variable and property. If I set any property in process record phase and try to get in on complete phase then always get null value. how to get those value in oncomplete phase? below is flow..

<batch:job name="TestBatch" max-failed-records="-1">
        <batch:input>

            <component class="com.test.RecordTest"
            doc:name="Java" />
        <json:object-to-json-transformer
            doc:name="Object to JSON" />
        <custom-transformer class="com.test.CustomTr"
            doc:name="Java" />
        </batch:input>
        <batch:process-records>
            <batch:step name="Batch_Step1" accept-policy="ALL">
                <batch:commit size="5" doc:name="Batch Commit">
                <!-- Insert record in Salesforce  -->
                </batch:commit>
            </batch:step>
            <batch:step name="Batch_Step2" accept-policy="ONLY_FAILURES">
                <logger message="STEPP #[getStepExceptions()]" level="INFO" doc:name="Logger"/>
                <set-property propertyName="error" value="STEPP #[getStepExceptions()]" doc:name="Property"/>
                <set-payload value="#[getStepExceptions()]" doc:name="Set Payload"/>

            </batch:step>

        </batch:process-records>
        <batch:on-complete>
            <logger level="INFO" doc:name="Logger" message="--&gt;  #[payload.failedRecords] --&gt;  #[message.payload] "/>
            <logger message="error--- #[message.outboundProperties['error']] " level="INFO" doc:name="Logger"/>

        </batch:on-complete>
    </batch:job>

我在属性记录器中为空

我该如何解决?

推荐答案

我从您那里得到了一些坏消息:-). 通过设计进行批处理不会保留您可能逐步尝试设置的任何值,尤其是有效负载.

I got some bad news from you :-). Batch processing by design will not old any of the value you may try to set in steps, especially payload.

当我开始使用它时,我也希望会话变量在完整阶段处于正确的状态,但事实并非如此,它们在每一步都被完全擦除了.

When I started working with it I was also expecting to have session variable on complete phase in a correct status but this is not the case, they are completely wiped at each step.

现在我不认为这是一个bug,但这确实是一个设计功能,即使我不太喜欢它也可以理解. 我通过使用对象存储连接器解决了相同的问题.

Now I don't think this is a bug, but it is really a design feature that I can understend even if I don't really love it. I solved the same problem by using the object store connector.

它将允许您通过漂亮的XML配置块访问mule对象存储API,这样您就可以在内存中存储变量,这些变量在完成后可以恢复,而不受流逻辑的影响.

It will allow you to access the mule Object Store API via nice XML configuration block, in this way you can store in memory variables that you can recover after in your on-complete without them being affected by flow logic.

希望这会有所帮助

这篇关于批处理Mule esb中的面向错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆