title: How to prevent Spring Boot daemon/server application from closing/shutting down immediately?
body: <p>My Spring Boot application is not a web server, but it's a server using custom protocol (using Camel in this case).</p>
  
  <p>But Spring Boot immediately stops (gracefully) after started. How do I prevent this?</p>
  
  <p>I'd like the app to stop if Ctrl+C or programmatically.</p>
  
  <pre><code>@CompileStatic
  @Configuration
  class CamelConfig {
  
      @Bean
      CamelContextFactoryBean camelContext() {
          final camelContextFactory = new CamelContextFactoryBean()
          camelContextFactory.id = 'camelContext'
          camelContextFactory
      }
  
  }
  </code></pre>