0

I made an instance of Camel Context and added the routes in the context as follows:

camelContext.addRoutes(new RouteBuilder() {
    @Override
    public void configure() throws Exception {
        System.out.println("in add route method");
        from("direct:start").routeId("contextRoute")
                .setHeader("client_id", constant("abc"))
                .setHeader("client_secret", constant("clk"))
                .setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
                .setHeader(Exchange.HTTP_URI, constant(url))
                .marshal(gsonDataFormat)
                .log("trying to send message")
                .to(url)
                .log("response is ${body}");
    }
});
camelContext.start();

However I am not able to get a log of my messages and debug the route. Is there an issue with the route or is there an issue with the log files or anything?

Anton Goncharov
  • 363
  • 3
  • 11
Rachit
  • 403
  • 10
  • 32
  • That is all code you are running ? How you send messages to direct:start ? I just replaced direct to timer component and wait for starting route and saw log messages, so i think it is working. – c0ld Mar 04 '20 at 10:54
  • But the examples I saw used timer and I only need to do it once, so what should be there in from? – Rachit Mar 04 '20 at 11:06
  • 1
    You need to read about timer component. It have repeatCount property. Just set it to 1, and it will only fire once. – c0ld Mar 04 '20 at 11:09

0 Answers0