Claus Ibsen created CAMEL-9720:
----------------------------------

             Summary: camel-spring-boot - Make it easy to keep the JVM running
                 Key: CAMEL-9720
                 URL: https://issues.apache.org/jira/browse/CAMEL-9720
             Project: Camel
          Issue Type: Improvement
          Components: camel-spring-boot
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.17.0


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
{code}
@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();
    }
}
{code}

We should be able to run that without the hack



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to