ESP Workload Automation

 View Only

 Need a way to do File Trigger for GCS file

dharwood's profile image
dharwood posted Dec 30, 2024 09:44 AM

Has anyone had any luck setting up a kind of file monitor using Google Cloud Storage (GCS) plugin extension? Initial tests show that running a PoJo EXIST method against a bucket will return 0 or 1 immediately.  

My initial thought would be to run a cyclic job to test the location, and use a conditional dependency to run workload when a file is detected, ie COND(RC(0)). 

I suspect it would be preferable to have the file checking done in some kind of script or wrapper, but this is new territory for an old dog. 

Would appreciate any input :) 

Lucy Zhang's profile image
Broadcom Employee Lucy Zhang

Hi Dave,

Following is an example for your initial thought, it's meant for explanation purpose, and we can provide more help based on the requirement:
EVENT ID(ESP.CHKGCS)  . . .
Proc    
APPL GCS
POJO_JOB  CHKFL
  REL ADD(GOOD COND(RC(0))
  REL ADD(RETRIG COND(RC(1))
  ....
ENDJOB

JOB GOOD
/* process that run after the file detected*/
....
ENDJOB  

JOB RERUM TASK SELFCOMPLETING
.......
/* force complete the JOB GOOD since file hasn't been detected*/
ESPNOMSG AJ GOOD COMPLETE APPL(....)
/* rerun the whole process, may add RELDELAY x minutes */
/* retrigger the event after x minutes 8*/
ENDJOB
EndProc 
ENDDEF 

I checked with our agent expert, and learned that there are customers who write their own scripts for this purpose and then use it as a command job, will see if someone may share here with you.

Happy Holidays!

Lucy

dharwood's profile image
dharwood

Solved: The correct Java method to use is 'create' instead of 'exist'.