This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/master by this push:
new 1d2120c CAMEL-15164: camel-lra-starter - Use same keys in auto
configuration as camel-main: camel.service.lra -> camel.lra
1d2120c is described below
commit 1d2120c33b95df9a696b1ab79ad57601b341a667
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Jun 11 12:15:33 2020 +0200
CAMEL-15164: camel-lra-starter - Use same keys in auto configuration as
camel-main: camel.service.lra -> camel.lra
---
.../camel-lra-starter/src/main/docs/lra-starter.adoc | 10 +++++-----
.../lra/springboot/LraServiceAutoConfiguration.java | 20 ++++++--------------
.../lra/springboot/LraServiceConfiguration.java | 2 +-
3 files changed, 12 insertions(+), 20 deletions(-)
diff --git
a/components-starter/camel-lra-starter/src/main/docs/lra-starter.adoc
b/components-starter/camel-lra-starter/src/main/docs/lra-starter.adoc
index 0c5527f..f9910e6 100644
--- a/components-starter/camel-lra-starter/src/main/docs/lra-starter.adoc
+++ b/components-starter/camel-lra-starter/src/main/docs/lra-starter.adoc
@@ -24,11 +24,11 @@ The component supports 5 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *camel.service.lra.coordinator-context-path* | The context path of the LRA
coordinator service | | String
-| *camel.service.lra.coordinator-url* | The base URL of the LRA coordinator
service (e.g. \http://lra-host:8080) | | String
-| *camel.service.lra.enabled* | Global option to enable/disable component
auto-configuration, default is true. | true | Boolean
-| *camel.service.lra.local-participant-context-path* | The context path of the
local participant callback services | | String
-| *camel.service.lra.local-participant-url* | The local URL where the
coordinator should send callbacks to (e.g. \http://my-host-name:8080) | |
String
+| *camel.lra.coordinator-context-path* | The context path of the LRA
coordinator service | | String
+| *camel.lra.coordinator-url* | The base URL of the LRA coordinator service
(e.g. \http://lra-host:8080) | | String
+| *camel.lra.enabled* | Global option to enable/disable component
auto-configuration, default is true. | true | Boolean
+| *camel.lra.local-participant-context-path* | The context path of the local
participant callback services | | String
+| *camel.lra.local-participant-url* | The local URL where the coordinator
should send callbacks to (e.g. \http://my-host-name:8080) | | String
|===
// spring-boot-auto-configure options: END
diff --git
a/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceAutoConfiguration.java
b/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceAutoConfiguration.java
index bba039c..246daaa 100644
---
a/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceAutoConfiguration.java
+++
b/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceAutoConfiguration.java
@@ -27,8 +27,6 @@ import
org.apache.camel.spring.boot.util.CamelPropertiesHelper;
import
org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
import org.apache.camel.spring.boot.util.GroupCondition;
import org.apache.camel.support.IntrospectionSupport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -45,31 +43,25 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties({LraServiceConfiguration.class})
public class LraServiceAutoConfiguration {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(LraServiceAutoConfiguration.class);
-
@Autowired
private CamelContext camelContext;
- @Autowired
- private LraServiceConfiguration configuration;
-
-
static class GroupConditions extends GroupCondition {
public GroupConditions() {
- super("camel.service", "camel.service.lra");
+ super("camel", "camel.lra");
}
}
@Bean(name = "lra-service")
@ConditionalOnMissingBean(CamelSagaService.class)
@ConditionalOnProperty(value = "camel.service.lra.enabled", havingValue =
"true")
- public LRASagaService configureLraSagaService() throws Exception {
+ public LRASagaService configureLraSagaService(LraServiceConfiguration
configuration) throws Exception {
LRASagaService service = new LRASagaService();
- Map<String, Object> parameters = new HashMap<>();
- IntrospectionSupport.getProperties(configuration, parameters, null,
false);
- CamelPropertiesHelper.setCamelProperties(camelContext, service,
parameters, false);
+ service.setCoordinatorUrl(configuration.getCoordinatorUrl());
+
service.setCoordinatorContextPath(configuration.getCoordinatorContextPath());
+ service.setLocalParticipantUrl(configuration.getLocalParticipantUrl());
+
service.setLocalParticipantContextPath(configuration.getLocalParticipantContextPath());
camelContext.addService(service);
return service;
diff --git
a/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceConfiguration.java
b/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceConfiguration.java
index ab088c2..ba7bbc1 100644
---
a/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceConfiguration.java
+++
b/components-starter/camel-lra-starter/src/main/java/org/apache/camel/service/lra/springboot/LraServiceConfiguration.java
@@ -24,7 +24,7 @@ import static
org.apache.camel.service.lra.LRAConstants.DEFAULT_LOCAL_PARTICIPAN
/**
* Spring-boot Auto-configuration for LRA service.
*/
-@ConfigurationProperties(prefix = "camel.service.lra")
+@ConfigurationProperties(prefix = "camel.lra")
public class LraServiceConfiguration {
/**