MonitorRouter.java 1021 B

123456789101112131415161718192021222324252627282930313233343536
  1. package camel.monitor.route;
  2. import com.mongodb.MongoClient;
  3. import org.apache.camel.builder.RouteBuilder;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.data.mongodb.core.MongoOperations;
  6. import org.springframework.stereotype.Component;
  7. /**
  8. * Created by l4qiang on 2017-06-16.
  9. */
  10. @Component
  11. public class MonitorRouter extends RouteBuilder {
  12. @Autowired
  13. private MongoClient mongoClient;
  14. @Autowired
  15. private MongoOperations mongoOperations;
  16. @Override
  17. public void configure() throws Exception {
  18. System.out.println("MonitorRouterBulider configure 111111111----------------");
  19. System.out.println("mongoClient:"+(mongoClient==null));
  20. System.out.println("mongoOperations:"+(mongoOperations==null));
  21. // from("quartz://monitor/logMonitorRoute?cron=0 0/1 * * * ?").routeId("logMonitorRoute")
  22. // .to("bean:monitorService?method=monitor")
  23. //// .bean(MonitorService.class,"monitor")
  24. // ;
  25. }
  26. }