How to chain two separate camel routes together for throttling -
i have 2 separate routes running in application , want control total amount of work in flight across entire path.
route 1: gzipped file on sftp --> unzip --> local directory route 2: local directory --> process stuff --> kafka
if route 2 has problems or falls behind in work, don't want route 1 fill local directory. how can limit total number of files sitting in local dir waiting processed?
(if single route may able throttle()
easier, there other options @ overall picture of multiple routes?)
you can implement custom routepolicy
check number of files in directory , if bigger x suspend route, , resume again if lower x.
see more details @ camel docs: http://camel.apache.org/routepolicy.html
you can @ existing throttlinginflightroutepolicy
how implemented inspiration.
Comments
Post a Comment