Facing error in batch processing mule esb

I ran into a problem in batch processing mule esb. If I installed any payload in the face of a process record and try to get this payload on an incomplete face, then not getting this payload. same problem with variable and property. If I set any property at the stage of processing the process and try to enter the full phase, then we always get a zero value. How to get these values ​​in an incomplete phase? lower 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 null in the property log

How can i solve this?

+2
source share
1 answer

I got bad news from you :-). Batch processing by design does not age any of the values ​​that you can try to set in steps, especially the payload.

When I started working with him, I also expected to have a session variable in full phase in the correct state, but it’s not, they are completely destroyed at every step.

Now I don’t think it’s a mistake, but it’s really a design function that I can understand, even if I really don’t like it. I solved the same problem using the object storage connector .

This will allow you to access the API store of the mule objects through a good XML configuration block, so you can store in memory variables that you can recover after completion in your entirety without exposing them to the flow logic.

Hope this helps

+3
source

Source: https://habr.com/ru/post/1242162/


All Articles