camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel P22 <pompadan...@gmail.com>
Subject Re: How to stop a dynamic route
Date Fri, 03 Jun 2016 15:55:50 GMT
Ranx explain to you, I have a route A, in that route you are going to put a
file with aaaaammdd date format. 

Then Im going to create a dinamic route in the Camel Context using that
date, this route is what you see in the example, I just wanna from the smb
endpoint the files according that date.

When finish the batch, stop and remove the route. I just wanna execute once. 

I use delay=60000  because I want this code to run.

*The Stop Code *


if(context.getRouteStatus("sap-xrt-connect-interface-receive-" +
fileNameOnly).isStarted()){  // Se verifica si se inicio la ruta 
        
                int CamelBatchValidator = 0; 
                do{ 
                
                Thread.sleep(10000); // Se realiza la verificacion cada 10
segundos si la interfaz culmino su procesamiento 
                     	
                if (CamelBatchComplete=="true"){ 
                
                 Thread.sleep(20000); // Tiempo adicional para verificar que
todo ha culminado 
                       	    
                 context.stopRoute("sap-xrt-connect-interface-receive-" +
fileNameOnly); 
                  
                 Thread.sleep(10000); 
                  
                 context.removeRoute("sap-xrt-connect-interface-receive-" +
fileNameOnly); 
                  
                     CamelBatchValidator=1; 
                     CamelBatchComplete = null; 
                }else{ 
                
                //Si la ruta esta vacia o hay error al conectar , esto hara
que entre en el IF de arriba y elimine la ruta 
                if(CamelBatchComplete == null){ 
                
                CamelBatchComplete="true"; 
                } 
                
                } 
                
                
                }while(CamelBatchValidator==0);


Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783460.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message