简体   繁体   中英

get output after batch processing in mule 4

I'm running one batch triggered by listener using postman. After batch processing i'm expecting some json response in the postman. tried to set the json in on-complete phase but getting some encrypted or collection data in the response. how can i send my own defined output to end user.

expected output:

{ "status": "completed" }

在此处输入图像描述

You can't return if the batch completed, because it will be executed asynchronously with respect to the caller flow.

What you can do is to decouple the status query from the execution. You can do that for example by updating the status in some persistent place, for example a database, when the batch completes. Then have a second HTTP Listener to check for the status can query that status and return immediately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM