camel组件实现文件转移
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@ServletComponentScan(basePackages = "com.iflytek.jtcn.vio")
@ImportResource(locations= {"classpath:spring-config.xml"})
public class VioToFtpApplication{
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(VioToFtpApplication.class);
@Bean
public void initData() throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
from("file:d:/test7").to("file:d:/test8");//这句话是核心
}
});
context.start();
}
public static void main(String[] args) {
log.info("camel组件启动成功:"+new Date());
SpringApplication.run(VioToFtpApplication.class, args);
}
}
原创不易,如果感觉不错,希望给个推荐!您的支持是我写作的最大动力!
浙公网安备 33010602011771号