Apache Camel 面试题与答案
问题 16. How to use Quartz Scheduler in Apache Camel?
You can use quartz scheduler in apache camel.
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-quartz</artifactId>
- <version>2.13.0</version>
- </dependency>
Coding Example:
- @Override
- public void configure() throws Exception {
- CronScheduledRoutePolicy startPolicy = new CronScheduledRoutePolicy();
- startPolicy.setRouteStartTime(â€0 0/3 * * * ?â€);
- from(â€file:C:/inputFolder? noop=trueâ€).routePolicy(startPolicy).noAutoStartup().process(new MyProcessor()) .to(â€file:C:/outputFolderâ€);
- }
问题 17. How to use Spring Boot with Apache Camel?
You can use Spring boot with Apache Camel.
问题 18. What is Idempotent Consumer pattern in Apache Camel?
In Apache Camel we use the Idempotent Consumer pattern to filter out duplicate messages. Consider a scenario where we have to process messages only once. If there are any duplicates they should be skipped. Using Apache Camel we can use Idempotent Consumer directly within the component so it will skip messages that are processed once. This feature is be enabled by setting the idempotent=true option. In order to achieve this Apache Camel keeps track of the consumed messages using a message id which is stored in the repository called Idempotent Repository. Apache Camel provides the following types of IdempotentRepository.
问题 19. How to connect with AWS service from Apache Camel?
Yes we can connect AWS services from Apache Camel using connector components.
问题 20. How to connect with Azure from Apache Camel?
Yes. We can connect with azure services using Apache camel connector components.
用户评价最有帮助的内容: