Search code examples
streamingmuleesb

In Mulesoft ESB how to trigger event after file writing is complete in streaming mode


I am trying to create a job in Salesforce.com for downloading a big data set and then streaming it into a file using Mulesoft ESB. While this is working fine, the job usually takes a good amount of time to execute and the file downloading happens after that. I need to figure out a way to communicate to users after the file download is complete. Since in streaming mode the file is downloading in a separate thread of its own, I am not able to figure out when it is complete. How can this be done?


Solution

  • Since there were no answers, let me post what I have done as of now.

    I used polling service to check status of job on SFDC. If status is completed, in the same process, I start the download process into a CSV file. The polling service also checks for status of download. Once download is complete, in a separate branch of this process, I use groovy to create a dynamic query for creating a table on mysql by getting the "Describe sobject" output from SFDC. I also create a dynamic "load data local infile.." query and run them to load the data into the mysql db.