I have an application that reads a file from a specific location and processes it. Now my requirement is to increase the no.of instances of application. How do I make sure that each instance does not pick the same file? Is there a way to make each instance to pick different file from the same file location? Please suggest.
How do I make different instances of an application to read different files to process?
302 Views Asked by swetha At
1
There are 1 best solutions below
Related Questions in PCFDEV
- PCF doesn't recognize the spring boot application
- Zuul ServiceId route is not working on CloudFoundry
- How can i change PCF (pcf-scripts) default port?
- After upgrading to Spring Boot 3, PCF Gorouter emits different x-b3-traceid
- Cloud Foundry CPU Core
- PCF Tasks on Active/Passive
- How do I use Hashicorp Vault in Cloud Foundry
- PCF cfdev plugin install No Such Host Error
- Socket Connection Exception while accesss external api in Pivotal Cloud Foundary
- Clone the request to a different Application in pcf
- Token validation failing in PCF but validating in local
- How to retrieve heapdump in PCF using SMB
- PCF - x509: certificate has expired or is not yet valid
- what is the alternative in Tanzu for https://console.run.pivotal.io/
- Run Time Argumnets in PCF
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Depends on few things:
How your application is triggered? if you are using something like spring batch scheduler then it's cause of worry as all instances get triggered and multiple instances can pick-up same files. Thus you need to have some logic within app to trigger only 1 instance like make an entry in the table and lock the table when processing begins so another trigger wont run until it finds the table available. Ensure to update and lock the table for one instance only to avoid multiple triggers. There are few other ways you can manage.
If you application is triggered by some other process then go-router will trigger only 1 instance at one time on round robin basis however if process takes some time and another instance gets triggered, then it might try picking up the same file. So may be you can move the file to some temp location when you pick up the file for processing and this way another trigger won't find the same file. Once processed successfully - it can be moved to 'done' folder..
How soon files gets uploaded to shared location? If its very frequent, best to move in unique temp folders as soon as app instance triggers and keep the staging folder with unpicked files only