Skip to content

[CAMEL-21862] camel-spring-boot - Remove deprecated camel.springboot. config prefix #1444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/camel-spring-boot/src/main/docs/spring-boot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ keeping the application alive by preventing JVM termination.
It means that after you start a Camel application with Spring Boot, your
application waits for a `Ctrl+C` signal and does not exit immediately.

The controller thread can be activated using the `camel.springboot.main-run-controller` to `true`.
The controller thread can be activated using the `camel.main.run-controller` to `true`.

[source,properties]
----
camel.springboot.main-run-controller = true
camel.main.run-controller = true
----

Applications using web modules (e.g. importing the `org.springframework.boot:spring-boot-web-starter` module),
Expand Down
1,258 changes: 6 additions & 1,252 deletions core/camel-spring-boot/src/main/docs/spring-boot.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ CamelContext camelContext(ApplicationContext applicationContext, CamelConfigurat
Clock clock = new ResetableClock();
CamelSpringBootApplicationController controller = new CamelSpringBootApplicationController(applicationContext);
CamelContext camelContext = new SpringBootCamelContext(applicationContext,
config.getSpringboot().isWarnOnEarlyShutdown(), controller);
config.getMain().isWarnOnEarlyShutdown(), controller);
camelContext.getClock().add(ContextEvents.BOOT, clock);
controller.setCamelContext(camelContext);
// bean post processor is created before CamelContext
Expand Down Expand Up @@ -292,7 +292,7 @@ static void configureStartupRecorder(CamelContext camelContext, CamelConfigurati
@ConditionalOnMissingBean(RoutesCollector.class)
@ConditionalOnMissingClass("org.apache.camel.spring.boot.endpointdsl.EndpointDslRouteCollector")
RoutesCollector routesCollector(ApplicationContext applicationContext, CamelConfigurationProperties config) {
return new CamelSpringBootRoutesCollector(applicationContext, config.getSpringboot().isIncludeNonSingletons());
return new CamelSpringBootRoutesCollector(applicationContext, config.getMain().isIncludeNonSingletons());
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void onApplicationEvent(ContextRefreshedEvent event) {
camelContextConfiguration.beforeApplicationStart(camelContext);
}

if (configurationProperties.getSpringboot().isMainRunController()) {
if (configurationProperties.getMain().isMainRunController()) {
CamelMainRunController controller = new CamelMainRunController(applicationContext, camelContext);

if (configurationProperties.getMain().getDurationMaxMessages() > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected synchronized void doStop() throws Exception {
if (!junit && !starterWeb) {
LOG.warn(
"CamelContext has only been running for less than a second. If you intend to run Camel for a longer time "
+ "then you can set the property camel.springboot.main-run-controller=true in application.properties"
+ "then you can set the property camel.main.run-controller=true in application.properties"
+ " or add spring-boot-starter-web JAR to the classpath.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.springframework.core.convert.support.DefaultConversionService;

@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(value = "camel.springboot.type-conversion", matchIfMissing = true)
@ConditionalOnProperty(value = "camel.main.type-conversion", matchIfMissing = true)
public class TypeConversionConfiguration {

// We explicitly declare the destroyMethod to be "" as the Spring @Bean
Expand Down
14 changes: 0 additions & 14 deletions core/camel-spring-boot/src/main/velocity/config.vm
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,15 @@ public class CamelConfigurationProperties {
// the need to generate this whole file using a velocity template.
//

@NestedConfigurationProperty
private final Springboot springboot = new Springboot();

@NestedConfigurationProperty
private final Main main = new Main();

public Springboot getSpringboot() {
return springboot;
}

public Main getMain() {
return main;
}

public class Main extends InnerCamelConfigurationProperties {

}

@SuppressWarnings("unused")
public class Springboot extends InnerDeprecatedCamelConfigurationProperties {
// Spring Boot only Properties
// ---------------------------

/**
* Whether to use the main run controller to ensure the Spring-Boot application
* keeps running until being stopped or the JVM terminated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@EnableAutoConfiguration
@SpringBootTest(classes = { CamelAutoConfiguration.class,
SupervisingRouteControllerRestartTest.TestConfiguration.class }, properties = {
"camel.springboot.main-run-controller = true", "camel.routecontroller.enabled = true",
"camel.main.run-controller = true", "camel.routecontroller.enabled = true",
"camel.routecontroller.initialDelay = 500", "camel.routecontroller.backoffDelay = 1000",
"camel.routecontroller.backoffMaxAttempts = 5", })
public class SupervisingRouteControllerRestartTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@EnableAutoConfiguration
@SpringBootTest(classes = { CamelAutoConfiguration.class,
SupervisingRouteControllerTest.TestConfiguration.class }, properties = {
"camel.springboot.routes-include-pattern = false", "camel.springboot.main-run-controller = true",
"camel.main.routes-include-pattern = false", "camel.main.run-controller = true",
"camel.routecontroller.enabled = true", "camel.routecontroller.initialDelay = 500",
"camel.routecontroller.backoffDelay = 1000", "camel.routecontroller.backoffMaxAttempts = 5", })
public class SupervisingRouteControllerTest {
Expand Down
4 changes: 2 additions & 2 deletions docs/spring-boot/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ with a Camel component.

== Making sure Camel context is running in standalone Spring Boot

To ensure the Spring Boot application keeps running until being stopped or the JVM terminated, typically only need when running Spring Boot standalone, i.e. not with `spring-boot-starter-web` when the web container keeps the JVM running, set the `camel.springboot.main-run-controller=true` property in your configuration. For example in `application.properties`.
To ensure the Spring Boot application keeps running until being stopped or the JVM terminated, typically only need when running Spring Boot standalone, i.e. not with `spring-boot-starter-web` when the web container keeps the JVM running, set the `camel.main.run-controller=true` property in your configuration. For example in `application.properties`.

[source]
----
# to keep the JVM running
camel.springboot.main-run-controller = true
camel.main.run-controller = true
----

== Spring Boot configuration support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class EndpointDslAutoConfiguration {
@Bean
RoutesCollector endpointDslRoutesCollector(ApplicationContext applicationContext,
CamelConfigurationProperties config) {
return new EndpointDslRouteCollector(applicationContext, config.getSpringboot().isIncludeNonSingletons());
return new EndpointDslRouteCollector(applicationContext, config.getMain().isIncludeNonSingletons());
}

}
Loading