Skip to content
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

Cleanup and CamelConfig improvements #397

Merged
merged 4 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions examples/rest-json/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
quarkus.log.file.enable = false
quarkus.ssl.native=true

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected void addReflectiveMethod(MethodInfo mi) {

/*
* NativeImage configuration steps related to camel main that are activated by default but can be
* disabled by setting quarkus.camel.enable-main = false
* disabled by setting quarkus.camel.main.enabled = false
*/
public static class Main {
@BuildStep(onlyIf = Flags.MainEnabled.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@
*/
package org.apache.camel.quarkus.core;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;

@ConfigRoot(name = "camel", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public class CamelConfig {
@ConfigRoot(name = "camel", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public static class BuildTime {
/**
* Build time configuration options for {@code camel-main}.
*/
@ConfigItem
public MainConfig main;

@ConfigGroup
public static class MainConfig {
/**
* Enable {@code camel-main}. If {@code true}, routes are automatically
* loaded and started and the entire lifecycle of the Camel Context is
Expand All @@ -31,16 +39,6 @@ public static class BuildTime {
* tasks.
*/
@ConfigItem(defaultValue = "true")
public boolean enableMain;
}

@ConfigRoot(name = "camel", phase = ConfigPhase.RUN_TIME)
public static class Runtime {

/**
* Dump loaded routes when starting
*/
@ConfigItem(defaultValue = "false")
public boolean dumpRoutes;
public boolean enabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ private Flags() {
public static final class MainEnabled implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return ConfigProvider.getConfig().getOptionalValue("quarkus.camel.enable-main", Boolean.class).orElse(Boolean.TRUE);
return ConfigProvider.getConfig().getOptionalValue("quarkus.camel.main.enabled", Boolean.class)
.orElse(Boolean.TRUE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ quarkus.log.file.enable = false
#
# Quarkus :: Camel
#
quarkus.camel.enable-main=false
quarkus.camel.dump-routes=true
quarkus.camel.main.enabled=false

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@ public JsonObject exchangeFormatterConfig() {
return result;
}

@Path("/registry/produces-config-build")
@GET
@Produces(MediaType.TEXT_PLAIN)
public boolean producesBuildTimeConfig() {
return lookupSingleInstanceFromRegistry(CamelConfig.BuildTime.class) != null;
}

@Path("/registry/produces-config-runtime")
@GET
@Produces(MediaType.TEXT_PLAIN)
public boolean producesRuntimeConfig() {
return lookupSingleInstanceFromRegistry(CamelConfig.Runtime.class) != null;
}

private <T> T lookupSingleInstanceFromRegistry(Class<T> type) {
final Set<T> answer = context.getRegistry().findByType(type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ quarkus.log.file.enable = false
#
# Quarkus :: Camel
#
quarkus.camel.enable-main=false
quarkus.camel.dump-routes=true
quarkus.camel.main.enabled=false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ quarkus.log.file.enable = false
quarkus.infinispan-client.server-list = localhost:11232
quarkus.infinispan-client.near-cache-max-entries = 3

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
#
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true

#
# Quarkus :: DS
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
#
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# Quarkus
#
quarkus.ssl.native=true
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
quarkus.log.file.enable = false
quarkus.ssl.native=true

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Quarkus :: Camel :: Servlet
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
package org.apache.camel.quarkus.component.snakeyaml.it;

import io.quarkus.test.junit.SubstrateTest;
import io.quarkus.test.junit.NativeImageTest;

@SubstrateTest
@NativeImageTest
class SnakeYAMLIT extends SnakeYAMLTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
quarkus.camel.dump-routes=true
#
# Camel
#
Expand Down