Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9259

enableTrace of the Main class doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.15.3
    • 2.16.1, 2.15.5, 2.17.0
    • camel-core
    • None
    • Unknown

    Description

      The enableTrace() method of the Camel Main class doesn't work.
      When we setup the code as such

          public static void main(String... args) throws Exception {
              Main main = new Main();
              main.enableHangupSupport();
              main.addRouteBuilder(new MyRouteBuilder());
              main.enableTrace();
              main.run(args);
      

      and launch the Main class, than the messages reported by the route in the log are not traced at all.

      If we debug, we can see that there is not CamelContext object when this method of the MainSupport class is called

          public void enableTrace() {
              this.trace = true;
              for (CamelContext context : camelContexts) { // EMPTY
                  context.setTracing(true);
              }
          }
      

      The workaround is to enable the tracing within the route definition

          public void configure() {
      
              getContext().setTracing(true);
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            cmoulliard Moulliard Charles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: