...
Code Block |
---|
|
package com.example;
... // imports
public class MyFatWarInitializer extends FatWarInitializer {
@Override
protected Class<? extends FatJarRouter> routerClass() {
return MyFatJarRouter.class;
}
} |
Blocking main thread
Camel applications extending FatJarRouter by default blocks the main thread of the application. It means that after you start your fat jar, your application waits for Ctrl+C signal and doesn't exit immediately. If you would like to achieve similar behavior for non-FatJarRouter
applications, retrieve CamelSpringBootApplicationController
bean from your ApplicationContext
and use the former to block the main thread of your application using CamelSpringBootApplicationController#blockMainThread()
method.
Code Block |
---|
|
public static void main(String... args) {
ApplicationContext applicationContext = new SpringApplication(MyCamelApplication.class).run(args);
CamelSpringBootApplicationController applicationController =
applicationContext.getBean(CamelSpringBootApplicationController.class);
applicationController.blockMainThread();
} |
Include Page |
---|
| Endpoint See Also |
---|
| Endpoint See Also |
---|
|