This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new ea38eadf65 Remove CamelQuarkusDataFormatConfigLifecycleStrategy and
CamelDataFormatRuntimeConfig
ea38eadf65 is described below
commit ea38eadf65fcc4112c06879195b6c8cdedcda438
Author: JinyuChen97 <[email protected]>
AuthorDate: Fri Aug 7 14:23:06 2026 +0100
Remove CamelQuarkusDataFormatConfigLifecycleStrategy and
CamelDataFormatRuntimeConfig
Fixes #7651
---
.../ROOT/pages/reference/extensions/core.adoc | 20 ------
.../core/deployment/CamelContextProcessor.java | 6 --
.../camel/quarkus/core/CamelContextRecorder.java | 16 -----
.../dataformat/CamelDataFormatRuntimeConfig.java | 48 ---------------
...elQuarkusDataFormatConfigLifecycleStrategy.java | 72 ----------------------
.../main/resources/META-INF/quarkus-extension.yaml | 1 -
6 files changed, 163 deletions(-)
diff --git a/docs/modules/ROOT/pages/reference/extensions/core.adoc
b/docs/modules/ROOT/pages/reference/extensions/core.adoc
index 66a56d8c56..a55cb291d9 100644
--- a/docs/modules/ROOT/pages/reference/extensions/core.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/core.adoc
@@ -375,26 +375,6 @@ Prints the `CamelMain` usage statement but allows the
application startup to pro
| `fail`, `warn`, `ignore`
| `warn`
-a|
[[camel-dataformat-data-format-configs]]`link:#camel-dataformat-data-format-configs[camel.dataformat."data-format-configs"]`
-
-Camel data format configuration.
-
-The format of the configuration is as follows.
-
-[source,properties]
-----
-camel.dataformat.<name>.<property> = value
-----
-
-For example.
-[source,properties]
-----
-camel.dataformat.beanio.stream-name = test-stream
-camel.dataformat.beanio.mapping = test-mapping.xml
-----
-| `Map<String,Map<String,String>>`
-|
-
a|
[[quarkus-camel-bootstrap-enabled]]`link:#quarkus-camel-bootstrap-enabled[quarkus.camel.bootstrap.enabled]`
When set to true, the {@link CamelRuntime} will be started automatically.
diff --git
a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
index 3738e40302..f478ebcabf 100644
---
a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
+++
b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
@@ -192,12 +192,6 @@ public class CamelContextProcessor {
return new CamelBootClockBuildItem(recorder.createBootClock(false));
}
- @Record(ExecutionTime.RUNTIME_INIT)
- @BuildStep
- RuntimeCamelContextCustomizerBuildItem
registerDataFormatLifecycleStrategy(CamelContextRecorder recorder) {
- return new
RuntimeCamelContextCustomizerBuildItem(recorder.registerDataFormatLifecycleStrategy());
- }
-
public static final class EventBridgeEnabled implements BooleanSupplier {
CamelConfig config;
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelContextRecorder.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelContextRecorder.java
index 84fb280f3a..47f27199f4 100644
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelContextRecorder.java
+++
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelContextRecorder.java
@@ -29,8 +29,6 @@ import org.apache.camel.catalog.RuntimeCamelCatalog;
import org.apache.camel.clock.Clock;
import org.apache.camel.impl.debugger.BacklogTracer;
import org.apache.camel.impl.engine.DefaultVariableRepositoryFactory;
-import org.apache.camel.quarkus.core.dataformat.CamelDataFormatRuntimeConfig;
-import
org.apache.camel.quarkus.core.dataformat.CamelQuarkusDataFormatConfigLifecycleStrategy;
import org.apache.camel.quarkus.core.devmode.NoOpModelineFactory;
import org.apache.camel.quarkus.core.devmode.NoShutdownStrategy;
import org.apache.camel.spi.CamelContextCustomizer;
@@ -50,11 +48,6 @@ import org.eclipse.microprofile.config.ConfigProvider;
@Recorder
public class CamelContextRecorder {
- private final RuntimeValue<CamelDataFormatRuntimeConfig> dataFormatConfig;
-
- public CamelContextRecorder(RuntimeValue<CamelDataFormatRuntimeConfig>
dataFormatConfig) {
- this.dataFormatConfig = dataFormatConfig;
- }
public RuntimeValue<CamelContext> createContext(
RuntimeValue<Registry> registry,
@@ -192,13 +185,4 @@ public class CamelContextRecorder {
return new RuntimeValue<>(clock);
}
- public RuntimeValue<CamelContextCustomizer>
registerDataFormatLifecycleStrategy() {
- return new RuntimeValue<>(new CamelContextCustomizer() {
- @Override
- public void configure(CamelContext camelContext) {
- camelContext.addLifecycleStrategy(
- new
CamelQuarkusDataFormatConfigLifecycleStrategy(camelContext,
dataFormatConfig.getValue()));
- }
- });
- }
}
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelDataFormatRuntimeConfig.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelDataFormatRuntimeConfig.java
deleted file mode 100644
index ff1b83330d..0000000000
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelDataFormatRuntimeConfig.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.core.dataformat;
-
-import java.util.Map;
-
-import io.quarkus.runtime.annotations.ConfigPhase;
-import io.quarkus.runtime.annotations.ConfigRoot;
-import io.smallrye.config.ConfigMapping;
-import io.smallrye.config.WithParentName;
-
-@ConfigRoot(phase = ConfigPhase.RUN_TIME)
-@ConfigMapping(prefix = "camel.dataformat")
-public interface CamelDataFormatRuntimeConfig {
- /**
- * Camel data format configuration.
- *
- * The format of the configuration is as follows.
- *
- * [source,properties]
- * ----
- * camel.dataformat.<name>.<property> = value
- * ----
- *
- * For example.
- * [source,properties]
- * ----
- * camel.dataformat.beanio.stream-name = test-stream
- * camel.dataformat.beanio.mapping = test-mapping.xml
- * ----
- */
- @WithParentName
- Map<String, Map<String, String>> dataFormatConfigs();
-}
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelQuarkusDataFormatConfigLifecycleStrategy.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelQuarkusDataFormatConfigLifecycleStrategy.java
deleted file mode 100644
index 43ab9f7008..0000000000
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/dataformat/CamelQuarkusDataFormatConfigLifecycleStrategy.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.core.dataformat;
-
-import java.util.Map;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Ordered;
-import org.apache.camel.spi.DataFormat;
-import org.apache.camel.support.LifecycleStrategySupport;
-import org.apache.camel.support.PropertyBindingSupport;
-import org.eclipse.microprofile.config.ConfigProvider;
-
-public class CamelQuarkusDataFormatConfigLifecycleStrategy extends
LifecycleStrategySupport implements Ordered {
- private final static Pattern KEBAB_CASE_PATTERN =
Pattern.compile("-([a-z])");
- private final CamelContext camelContext;
- private final CamelDataFormatRuntimeConfig config;
-
- public CamelQuarkusDataFormatConfigLifecycleStrategy(CamelContext
camelContext, CamelDataFormatRuntimeConfig config) {
- this.camelContext = camelContext;
- this.config = config;
- }
-
- @Override
- public void onDataFormatCreated(String name, DataFormat dataFormat) {
- if (config.dataFormatConfigs().containsKey(name) &&
isCustomizersEnabled()) {
- // Convert the config keys to camel case for property binding
- Map<String, Object> camelCaseMap = config.dataFormatConfigs()
- .get(name)
- .entrySet()
- .stream()
- .collect(Collectors.toMap(
- entry ->
KEBAB_CASE_PATTERN.matcher(entry.getKey()).replaceAll(mr ->
mr.group(1).toUpperCase()),
- Map.Entry::getValue));
-
-
PropertyBindingSupport.build().withIgnoreCase(true).bind(camelContext,
dataFormat, camelCaseMap);
- }
- }
-
- @Override
- public int getOrder() {
- return Ordered.HIGHEST;
- }
-
- static boolean isCustomizersEnabled() {
- Boolean dataFormatCustomizerEnabled = ConfigProvider.getConfig()
-
.getOptionalValue("camel.component.dataformat.customizer.enabled",
boolean.class)
- .orElse(true);
-
- Boolean componentCustomizerEnabled = ConfigProvider.getConfig()
- .getOptionalValue("camel.component.customizer.enabled",
boolean.class)
- .orElse(true);
-
- return dataFormatCustomizerEnabled && componentCustomizerEnabled;
- }
-}
diff --git
a/extensions-core/core/runtime/src/main/resources/META-INF/quarkus-extension.yaml
b/extensions-core/core/runtime/src/main/resources/META-INF/quarkus-extension.yaml
index fbd27889c8..16e8897eeb 100644
---
a/extensions-core/core/runtime/src/main/resources/META-INF/quarkus-extension.yaml
+++
b/extensions-core/core/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -30,7 +30,6 @@ metadata:
categories:
- "integration"
config:
- - "camel.dataformat"
- "quarkus.camel"
- "quarkus.camel.main"
status: "stable"