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

camel-spring-boot - Make it easy to keep the JVM running

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • camel-spring-boot
    • None
    • Unknown

    Description

      When you run a spring boot app then it may terminate asap because the main thread is not keep running.

      We should make this easy.

      And that applies when you code this using the spring boot way with a application class with main.

      eg along the lines using this hack for now

      @SpringBootApplication
      public class SampleCamelApplication {
      
          public static void main(String[] args) {
              ConfigurableApplicationContext ctx = new SpringApplicationBuilder().sources(SampleCamelApplication.class).run(args);
      
              // keep the JVM running as Camel uses only daemon threads in the sample
              CamelSpringBootApplicationController controller = ctx.getBean(CamelSpringBootApplicationController.class);
              controller.blockMainThread();
          }
      }
      

      We should be able to run that without the hack

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: