Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CamelJmsMain {
- private static Logger log = Logger.getLogger(CamelMain.class);
- public static void main(String[] args) throws Exception {
- log.info("Starting application");
- CamelContext context = new DefaultCamelContext();
- context.addComponent("activemq", ActiveMQComponent.activeMQComponent("tcp://localhost:61616"));
- context.addRoutes(new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- errorHandler(loggingErrorHandler("error.log").level(LoggingLevel.INFO));
- onException(Exception.class).handled(true).log(LoggingLevel.INFO, "Exception caught");
- from("activemq:test").to("log:output");
- }
- });
- context.setErrorHandlerBuilder(new LoggingErrorHandlerBuilder(LoggerFactory.getLogger("error.log")));
- context.start();
- log.info("Camel started");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment