The configure() method not getting called in Apache camel routing

115 Views Asked by At

I am trying to use camel routing in my SpringBoot project. I have created a class named CamelFileRoute that extends RouteBuilder. When I log something inside the constructor, it is printed in the console. However, the logs inside the configure() method are not getting printed. Why is the configure method not getting called?

Below is my code-


package com.reet.camel.route;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

import lombok.extern.java.Log;

@Component
public class CamelFileRoute extends RouteBuilder{
    
    public CamelFileRoute() {
        // TODO Auto-generated constructor stub
        System.out.println("Inside constructor");
    }

    @Override
    public void configure() {
        System.out.println("Inside configure");
        
        from("file:files/input")
        .log("${body}")
        .to("file:files/output")
        .log("${body}");
        
    }

}

Expected output-
Inside constructor
Inside configure

Actual output-
Inside constructor

0

There are 0 best solutions below