I am trying to execute shell script with camel and tried the following code, everything is looking fine its starting the route but I have following 2 issues
- Shell script file is not picking and executing the commands in it.
- Not even getting log messages that I kept all over in my code.
following is the route that I am using
@component
public class ShellRoute extends RouteBuilder
{
@override
public void configure()
{
final Logger logger = LoggerFactory.getLogger(ShellRoute.class);
logger.info("shellRoute");
boolean startupRoute=true;
from("direct:start")
.log(LoggingLevel.INFO, "Enter into Route:")
.routeID("ShellRoute")
.autoStartup(startupRoute)
.onException(Exception.class);
.logExhausted(false)
.logStackTrace(false)
.end()
.log(LoggingLevel.INFO, "Starting Script:")
.to("exec:./run_setup.sh?args=dev")
.log(LoggingLevel.INFO, "End of Script:");
}
}
Following is the Log:
2017-09-29 08:32:53 INFO Version:30 - HV000001: Hibernate Validator 5.2.4.Final
2017-09-29 08:32:53 INFO SupportMain:48 - Starting SupportMain on VDDP13C-52C8C99.mis.lmig.com with PID 13002 (/data/userdata/workspaces/ClaimDownload/support/target/classes started by mani in /data/userdata/workspaces/ClaimDownload/support)
2017-09-29 08:32:53 INFO SupportMain:669 - The following profiles are active: local
2017-09-29 08:32:53 INFO AnnotationConfigApplicationContext:581 - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@776aec5c: startup date [Fri Sep 29 08:32:53 EDT 2017]; root of context hierarchy 2017-09-29 08:32:55 INFO PostProcessorRegistrationDelegate$BeanPostProcessorChecker:328 - Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [class org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$9509da1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-09-29 08:32:56 INFO DefaultTypeConverter:56 - Loaded 209 type converters
2017-09-29 08:32:57 INFO AnnotationMBeanExporter:431 - Registering beans for JMX exposure on startup
2017-09-29 08:32:57 INFO ShellRoute:33 - ShellRoute
2017-09-29 08:32:57 INFO RoutesCollector:148 - Loading additional Camel XML routes from: classpath:camel/*.xml
2017-09-29 08:32:57 INFO RoutesCollector:162 - Loading additional Camel XML rests from: classpath:camel-rest/*.xml
2017-09-29 08:32:57 INFO SpringCamelContext:2800 - Apache Camel 2.17.2 (CamelContext: camel-1) is starting
2017-09-29 08:32:57 INFO ManagedManagementStrategy:191 - JMX is enabled
2017-09-29 08:32:57 INFO DefaultRuntimeEndpointRegistry:203 - Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2017-09-29 08:32:57 INFO SpringCamelContext:3039 - AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2017-09-29 08:32:57 INFO SpringCamelContext:3049 - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2017-09-29 08:32:57 INFO SpringCamelContext:3570 - Route: ShellRoute started and consuming from: Endpoint[direct://start]
2017-09-29 08:32:57 INFO SpringCamelContext:2840 - Total 1 routes, of which 1 are started.
2017-09-29 08:32:57 INFO SpringCamelContext:2841 - Apache Camel 2.17.2 (CamelContext: camel-1) started in 0.667 seconds
2017-09-29 08:32:57 INFO SupportMain:57 - Started SupportMain in 4.963 seconds (JVM running for 6.767)
2017-09-29 08:32:57 INFO AnnotationConfigApplicationContext:982 - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@776aec5c: startup date [Fri Sep 29 08:32:53 EDT 2017]; root of context hierarchy
2017-09-29 08:32:57 INFO AnnotationMBeanExporter:449 - Unregistering JMX-exposed beans on shutdown
2017-09-29 08:32:57 INFO SpringCamelContext:3066 - Apache Camel 2.17.2 (CamelContext: camel-1) is shutting down