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

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.17.0
    • Component/s: camel-spring-boot
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: