You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/02 10:42:11 UTC

[camel-spring-boot] branch main updated: CAMEL-19225: camel-jpa - remove transactionManager property (#10954)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 52fbea0d478 CAMEL-19225: camel-jpa - remove transactionManager property (#10954)
52fbea0d478 is described below

commit 52fbea0d4784e9eaa21b365e15c9fb5b9eac2bf4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Aug 2 12:41:54 2023 +0200

    CAMEL-19225: camel-jpa - remove transactionManager property (#10954)
---
 .../camel/springboot/catalog/components/jpa.json    | 13 ++++++-------
 .../camel-jpa-starter/src/main/docs/jpa.json        |  8 --------
 .../jpa/springboot/JpaComponentConfiguration.java   | 21 ---------------------
 .../jpa/springboot/JpaComponentConverter.java       |  2 --
 4 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/jpa.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/jpa.json
index e10bceebb73..843f0d39007 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/jpa.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/jpa.json
@@ -26,13 +26,12 @@
     "entityManagerFactory": { "index": 1, "kind": "property", "displayName": "Entity Manager Factory", "group": "common", "label": "", "required": false, "type": "object", "javaType": "jakarta.persistence.EntityManagerFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use the EntityManagerFactory. This is strongly recommended to configure." },
     "joinTransaction": { "index": 2, "kind": "property", "displayName": "Join Transaction", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The camel-jpa component will join transaction by default. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can [...]
     "sharedEntityManager": { "index": 3, "kind": "property", "displayName": "Shared Entity Manager", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to use Spring's SharedEntityManager for the consumer\/producer. Note in most cases joinTransaction should be set to false as this is not an EXTENDED EntityManager." },
-    "transactionManager": { "index": 4, "kind": "property", "displayName": "Transaction Manager", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.springframework.transaction.PlatformTransactionManager", "deprecated": true, "autowired": false, "secret": false, "description": "To use the PlatformTransactionManager for managing transactions." },
-    "transactionStrategy": { "index": 5, "kind": "property", "displayName": "Transaction Strategy", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.jpa.TransactionStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use the TransactionStrategy for running the operations in a transaction." },
-    "bridgeErrorHandler": { "index": 6, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be proce [...]
-    "lazyStartProducer": { "index": 7, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
-    "autowiredEnabled": { "index": 8, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
-    "healthCheckConsumerEnabled": { "index": 9, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" },
-    "healthCheckProducerEnabled": { "index": 10, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...]
+    "transactionStrategy": { "index": 4, "kind": "property", "displayName": "Transaction Strategy", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.jpa.TransactionStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use the TransactionStrategy for running the operations in a transaction." },
+    "bridgeErrorHandler": { "index": 5, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be proce [...]
+    "lazyStartProducer": { "index": 6, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
+    "autowiredEnabled": { "index": 7, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
+    "healthCheckConsumerEnabled": { "index": 8, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" },
+    "healthCheckProducerEnabled": { "index": 9, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer [...]
   },
   "headers": {
     "CamelEntityManager": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "jakarta.persistence.EntityManager", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JPA EntityManager object.", "constantName": "org.apache.camel.component.jpa.JpaConstants#ENTITY_MANAGER" },
diff --git a/components-starter/camel-jpa-starter/src/main/docs/jpa.json b/components-starter/camel-jpa-starter/src/main/docs/jpa.json
index bdd2a15433a..9cb5502b2cd 100644
--- a/components-starter/camel-jpa-starter/src/main/docs/jpa.json
+++ b/components-starter/camel-jpa-starter/src/main/docs/jpa.json
@@ -90,14 +90,6 @@
       "type": "org.apache.camel.component.jpa.TransactionStrategy",
       "description": "To use the TransactionStrategy for running the operations in a transaction. The option is a org.apache.camel.component.jpa.TransactionStrategy type.",
       "sourceType": "org.apache.camel.component.jpa.springboot.JpaComponentConfiguration"
-    },
-    {
-      "name": "camel.component.jpa.transaction-manager",
-      "type": "org.springframework.transaction.PlatformTransactionManager",
-      "description": "To use the PlatformTransactionManager for managing transactions. The option is a org.springframework.transaction.PlatformTransactionManager type.",
-      "sourceType": "org.apache.camel.component.jpa.springboot.JpaComponentConfiguration",
-      "deprecated": true,
-      "deprecation": {}
     }
   ],
   "hints": []
diff --git a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConfiguration.java b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConfiguration.java
index 7cdc613aca8..f01ca2eedda 100644
--- a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConfiguration.java
+++ b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConfiguration.java
@@ -21,8 +21,6 @@ import jakarta.persistence.EntityManagerFactory;
 import org.apache.camel.component.jpa.TransactionStrategy;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
-import org.springframework.transaction.PlatformTransactionManager;
 
 /**
  * Store and retrieve Java objects from databases using Java Persistence API
@@ -64,13 +62,6 @@ public class JpaComponentConfiguration
      * an EXTENDED EntityManager.
      */
     private Boolean sharedEntityManager = false;
-    /**
-     * To use the PlatformTransactionManager for managing transactions. The
-     * option is a org.springframework.transaction.PlatformTransactionManager
-     * type.
-     */
-    @Deprecated
-    private PlatformTransactionManager transactionManager;
     /**
      * To use the TransactionStrategy for running the operations in a
      * transaction. The option is a
@@ -152,18 +143,6 @@ public class JpaComponentConfiguration
         this.sharedEntityManager = sharedEntityManager;
     }
 
-    @Deprecated
-    @DeprecatedConfigurationProperty
-    public PlatformTransactionManager getTransactionManager() {
-        return transactionManager;
-    }
-
-    @Deprecated
-    public void setTransactionManager(
-            PlatformTransactionManager transactionManager) {
-        this.transactionManager = transactionManager;
-    }
-
     public TransactionStrategy getTransactionStrategy() {
         return transactionStrategy;
     }
diff --git a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
index 11a23903972..66a2fc34e1e 100644
--- a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
+++ b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
@@ -40,7 +40,6 @@ public class JpaComponentConverter implements GenericConverter {
     public Set<ConvertiblePair> getConvertibleTypes() {
         Set<ConvertiblePair> answer = new LinkedHashSet<>();
         answer.add(new ConvertiblePair(String.class, jakarta.persistence.EntityManagerFactory.class));
-        answer.add(new ConvertiblePair(String.class, org.springframework.transaction.PlatformTransactionManager.class));
         answer.add(new ConvertiblePair(String.class, org.apache.camel.component.jpa.TransactionStrategy.class));
         return answer;
     }
@@ -59,7 +58,6 @@ public class JpaComponentConverter implements GenericConverter {
         ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
         switch (targetType.getName()) {
             case "jakarta.persistence.EntityManagerFactory": return applicationContext.getBean(ref, jakarta.persistence.EntityManagerFactory.class);
-            case "org.springframework.transaction.PlatformTransactionManager": return applicationContext.getBean(ref, org.springframework.transaction.PlatformTransactionManager.class);
             case "org.apache.camel.component.jpa.TransactionStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jpa.TransactionStrategy.class);
         }
         return null;