diff --git a/src/main/java/com/google/api/generator/spring/SpringWriter.java b/src/main/java/com/google/api/generator/spring/SpringWriter.java index d88229afad..67925a38bd 100644 --- a/src/main/java/com/google/api/generator/spring/SpringWriter.java +++ b/src/main/java/com/google/api/generator/spring/SpringWriter.java @@ -20,7 +20,7 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; -import com.google.api.generator.spring.composer.Utils; +import com.google.api.generator.spring.utils.Utils; import com.google.protobuf.ByteString; import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse; import com.google.protobuf.util.JsonFormat; diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java index b9ea62830d..cec37f1b75 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java @@ -19,6 +19,7 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.generator.engine.ast.AnnotationNode; +import com.google.api.generator.engine.ast.ArithmeticOperationExpr; import com.google.api.generator.engine.ast.AssignmentExpr; import com.google.api.generator.engine.ast.CastExpr; import com.google.api.generator.engine.ast.ClassDefinition; @@ -47,6 +48,8 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicServiceConfig; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.spring.utils.LoggerUtils; +import com.google.api.generator.spring.utils.Utils; import com.google.common.base.CaseFormat; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; @@ -157,7 +160,9 @@ private static List createMemberVariables( .build(); ExprStatement clientPropertiesStatement = ExprStatement.withExpr(clientPropertiesVarExpr); - return Arrays.asList(clientPropertiesStatement); + Statement loggerStatement = + LoggerUtils.getLoggerDeclarationExpr(serviceName + "AutoConfig", types); + return Arrays.asList(clientPropertiesStatement, loggerStatement); } private static MethodDefinition createConstructor( @@ -559,10 +564,19 @@ private static MethodDefinition createClientBeanMethod( .setArguments(getQuotaProjectId) .build(); + ExprStatement projectIdLoggerStatement = + LoggerUtils.createLoggerStatement( + LoggerUtils.concatManyWithExprs( + ValueExpr.withValue(StringObjectValue.withValue("Quota project id set to ")), + getQuotaProjectId, + ValueExpr.withValue( + StringObjectValue.withValue(", this overrides project id from credentials."))), + types); + IfStatement setQuotaProjectIdStatement = createIfStatement( projectIdIsNull, - Arrays.asList(ExprStatement.withExpr(setQuotaProjectId)), // TODO add logger info + Arrays.asList(ExprStatement.withExpr(setQuotaProjectId), projectIdLoggerStatement), null); bodyStatements.add(setQuotaProjectIdStatement); @@ -621,12 +635,20 @@ private static MethodDefinition createClientBeanMethod( .setArguments(executorProviderVarExpr) .build(); + ExprStatement backgroundExecutorLoggerStatement = + LoggerUtils.createLoggerStatement( + ArithmeticOperationExpr.concatWithExprs( + ValueExpr.withValue( + StringObjectValue.withValue("Background executor thread count is ")), + getExecutorThreadCount), + types); IfStatement setBackgroundExecutorProviderStatement = createIfStatement( executorThreadCountIsNull, Arrays.asList( ExprStatement.withExpr(executorProviderAssignExpr), - ExprStatement.withExpr(setBackgroundExecutorProvider)), // TODO add logger info + ExprStatement.withExpr(setBackgroundExecutorProvider), + backgroundExecutorLoggerStatement), null); bodyStatements.add(setBackgroundExecutorProviderStatement); @@ -664,7 +686,14 @@ private static MethodDefinition createClientBeanMethod( .build(); IfStatement setTransportChannelProviderStatement = createIfStatement( - getUseRest, Arrays.asList(ExprStatement.withExpr(setTransportProvider)), null); + getUseRest, + Arrays.asList( + ExprStatement.withExpr(setTransportProvider), + LoggerUtils.createLoggerStatement( + ValueExpr.withValue( + StringObjectValue.withValue("Using HTTP transport channel")), + types)), + null); bodyStatements.add(setTransportChannelProviderStatement); @@ -721,7 +750,14 @@ private static MethodDefinition createClientBeanMethod( IfStatement currentRetrySettingPropertyIfStatement = createIfStatement( currentRetrySettingPropertyIsNull, - Arrays.asList(ExprStatement.withExpr(retrySettingsBuilderChain)), + Arrays.asList( + ExprStatement.withExpr(retrySettingsBuilderChain), + LoggerUtils.createLoggerStatement( + LoggerUtils.concatManyWithExprs( + ValueExpr.withValue( + StringObjectValue.withValue(propertyName + " set to ")), + currentRetrySettingProperty), + types)), null); statements.add(currentRetrySettingPropertyIfStatement); return statements; @@ -947,6 +983,8 @@ private static Map createDynamicTypes(Service service, String typeMap.put("ConditionalOnProperty", conditionalOnProperty); typeMap.put("ConditionalOnClass", conditionalOnClass); typeMap.put("Qualifier", qualifier); + typeMap.put("Log", LoggerUtils.getLoggerType()); + typeMap.put("LogFactory", LoggerUtils.getLoggerFactoryType()); return typeMap; } diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java index 5f93156f72..00c1c3557f 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java @@ -41,6 +41,7 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicServiceConfig; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.spring.utils.Utils; import com.google.common.base.CaseFormat; import com.google.common.base.Joiner; import java.util.ArrayList; diff --git a/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java b/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java new file mode 100644 index 0000000000..31cce78ed2 --- /dev/null +++ b/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java @@ -0,0 +1,109 @@ +// Copyright 2022 Google LLC +// +// Licensed 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 com.google.api.generator.spring.utils; + +import com.google.api.generator.engine.ast.ArithmeticOperationExpr; +import com.google.api.generator.engine.ast.AssignmentExpr; +import com.google.api.generator.engine.ast.Expr; +import com.google.api.generator.engine.ast.ExprStatement; +import com.google.api.generator.engine.ast.MethodInvocationExpr; +import com.google.api.generator.engine.ast.ScopeNode; +import com.google.api.generator.engine.ast.Statement; +import com.google.api.generator.engine.ast.TypeNode; +import com.google.api.generator.engine.ast.VaporReference; +import com.google.api.generator.engine.ast.Variable; +import com.google.api.generator.engine.ast.VariableExpr; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class LoggerUtils { + + public static Statement getLoggerDeclarationExpr(String className, Map types) { + + Variable loggerVar = Variable.builder().setName("LOGGER").setType(types.get("Log")).build(); + VariableExpr loggerExpr = + VariableExpr.builder() + .setVariable(loggerVar) + .setScope(ScopeNode.PRIVATE) + .setIsStatic(true) + .setIsFinal(true) + .setIsDecl(true) + .build(); + + MethodInvocationExpr loggerValueExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(types.get("LogFactory")) + .setMethodName("getLog") + .setArguments( + VariableExpr.builder() + .setVariable( + Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build()) + .setStaticReferenceType(types.get(className)) + .build()) + .setReturnType(types.get("Log")) + .build(); + + AssignmentExpr loggerAssignmentExpr = + AssignmentExpr.builder().setVariableExpr(loggerExpr).setValueExpr(loggerValueExpr).build(); + + return ExprStatement.withExpr(loggerAssignmentExpr); + } + + public static ExprStatement createLoggerStatement(Expr value, Map types) { + Variable loggerVariable = + Variable.builder().setName("LOGGER").setType(types.get("Log")).build(); + MethodInvocationExpr loggerCallExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(VariableExpr.withVariable(loggerVariable)) + .setMethodName("info") + .setArguments(value) + .build(); + return ExprStatement.withExpr(loggerCallExpr); + } + + public static TypeNode getLoggerType() { + return createType("Log", "org.apache.commons.logging"); + } + + public static TypeNode getLoggerFactoryType() { + return createType("LogFactory", "org.apache.commons.logging"); + } + + private static TypeNode createType(String className, String pakkage) { + TypeNode loggerType = + TypeNode.withReference( + VaporReference.builder().setName(className).setPakkage(pakkage).build()); + return loggerType; + } + + public static Expr concatManyWithExprs(Expr... exprs) { + List exprList = Arrays.asList(exprs); + return concatManyWithExprsHelper(Optional.empty(), exprList); + } + + private static Expr concatManyWithExprsHelper(Optional current, List exprs) { + if (!current.isPresent()) { + return concatManyWithExprsHelper(Optional.of(exprs.get(0)), exprs.subList(1, exprs.size())); + } + if (exprs.size() == 1) { + return ArithmeticOperationExpr.concatWithExprs(current.get(), exprs.get(0)); + } + return ArithmeticOperationExpr.concatWithExprs( + current.get(), + concatManyWithExprsHelper(Optional.of(exprs.get(0)), exprs.subList(1, exprs.size()))); + } +} diff --git a/src/main/java/com/google/api/generator/spring/composer/Utils.java b/src/main/java/com/google/api/generator/spring/utils/Utils.java similarity index 99% rename from src/main/java/com/google/api/generator/spring/composer/Utils.java rename to src/main/java/com/google/api/generator/spring/utils/Utils.java index f568bbf5ef..dea2b743f3 100644 --- a/src/main/java/com/google/api/generator/spring/composer/Utils.java +++ b/src/main/java/com/google/api/generator/spring/utils/Utils.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.api.generator.spring.composer; +package com.google.api.generator.spring.utils; import com.google.api.generator.engine.ast.AstNode; import com.google.api.generator.engine.ast.Expr; diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden index e85c82e9ac..be91d0f036 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden @@ -10,6 +10,8 @@ import com.google.showcase.v1beta1.EchoClient; import com.google.showcase.v1beta1.EchoSettings; import java.io.IOException; import javax.annotation.Generated; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -27,6 +29,7 @@ import org.threeten.bp.Duration; @EnableConfigurationProperties(EchoSpringProperties.class) public class EchoSpringAutoConfiguration { private final EchoSpringProperties clientProperties; + private static final Log LOGGER = LogFactory.getLog(EchoSpringAutoConfig.class); protected EchoSpringAutoConfiguration(EchoSpringProperties clientProperties) { this.clientProperties = clientProperties; @@ -58,6 +61,10 @@ public class EchoSpringAutoConfiguration { .setHeaderProvider(); if (this.clientProperties.getQuotaProjectId() != null) { clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + LOGGER.info( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); } if (this.clientProperties.getExecutorThreadCount() != null) { ExecutorProvider executorProvider = @@ -65,37 +72,51 @@ public class EchoSpringAutoConfiguration { .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) .build(); clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + LOGGER.info( + "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); } if (this.clientProperties.getUseRest()) { clientSettingsBuilder.setTransportChannelProvider( EchoSettings.defaultHttpJsonTransportProviderBuilder().build()); + LOGGER.info("Using HTTP transport channel"); } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { echoRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getEchoInitialRetryDelay()); + LOGGER.info( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); } if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { echoRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getEchoRetryDelayMultiplier()); + LOGGER.info( + "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); } if (this.clientProperties.getEchoMaxRetryDelay() != null) { echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); + LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); } if (this.clientProperties.getEchoInitialRpcTimeout() != null) { echoRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getEchoInitialRpcTimeout()); + LOGGER.info( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); } if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { echoRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getEchoRpcTimeoutMultiplier()); + LOGGER.info( + "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); } if (this.clientProperties.getEchoMaxRpcTimeout() != null) { echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); + LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); } if (this.clientProperties.getEchoTotalTimeout() != null) { echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); + LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); } clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); RetrySettings.Builder expandRetrySettingBuilder = @@ -103,27 +124,40 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getExpandInitialRetryDelay() != null) { expandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getExpandInitialRetryDelay()); + LOGGER.info( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); } if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { expandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getExpandRetryDelayMultiplier()); + LOGGER.info( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); } if (this.clientProperties.getExpandMaxRetryDelay() != null) { expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); + LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); } if (this.clientProperties.getExpandInitialRpcTimeout() != null) { expandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getExpandInitialRpcTimeout()); + LOGGER.info( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); } if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { expandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getExpandRpcTimeoutMultiplier()); + LOGGER.info( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getExpandMaxRpcTimeout() != null) { expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); + LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); } if (this.clientProperties.getExpandTotalTimeout() != null) { expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); + LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); } clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); RetrySettings.Builder collectRetrySettingBuilder = @@ -131,16 +165,23 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollectInitialRpcTimeout() != null) { collectRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollectInitialRpcTimeout()); + LOGGER.info( + "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); } if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { collectRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollectRpcTimeoutMultiplier()); + LOGGER.info( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); } if (this.clientProperties.getCollectMaxRpcTimeout() != null) { collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); + LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); } if (this.clientProperties.getCollectTotalTimeout() != null) { collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); + LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); } clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); RetrySettings.Builder chatRetrySettingBuilder = @@ -148,16 +189,22 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatInitialRpcTimeout() != null) { chatRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatInitialRpcTimeout()); + LOGGER.info( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); } if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { chatRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatRpcTimeoutMultiplier()); + LOGGER.info( + "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); } if (this.clientProperties.getChatMaxRpcTimeout() != null) { chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); + LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); } if (this.clientProperties.getChatTotalTimeout() != null) { chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); + LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); } clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); RetrySettings.Builder chatAgainRetrySettingBuilder = @@ -165,18 +212,28 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { chatAgainRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatAgainInitialRpcTimeout()); + LOGGER.info( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); } if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + LOGGER.info( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); } if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { chatAgainRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getChatAgainMaxRpcTimeout()); + LOGGER.info( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); } if (this.clientProperties.getChatAgainTotalTimeout() != null) { chatAgainRetrySettingBuilder.setTotalTimeout( this.clientProperties.getChatAgainTotalTimeout()); + LOGGER.info( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); } clientSettingsBuilder .chatAgainSettings() @@ -186,30 +243,48 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { pagedExpandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getPagedExpandInitialRetryDelay()); + LOGGER.info( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); } if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getPagedExpandRetryDelayMultiplier()); + LOGGER.info( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); } if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { pagedExpandRetrySettingBuilder.setMaxRetryDelay( this.clientProperties.getPagedExpandMaxRetryDelay()); + LOGGER.info( + "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); } if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getPagedExpandInitialRpcTimeout()); + LOGGER.info( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); } if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getPagedExpandMaxRpcTimeout()); + LOGGER.info( + "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); } if (this.clientProperties.getPagedExpandTotalTimeout() != null) { pagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getPagedExpandTotalTimeout()); + LOGGER.info( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); } clientSettingsBuilder .pagedExpandSettings() @@ -219,18 +294,30 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + LOGGER.info( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); } if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + LOGGER.info( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); } if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { simplePagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getSimplePagedExpandTotalTimeout()); + LOGGER.info( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); } clientSettingsBuilder .simplePagedExpandSettings() @@ -240,16 +327,22 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getWaitInitialRpcTimeout() != null) { waitRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getWaitInitialRpcTimeout()); + LOGGER.info( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); } if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { waitRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getWaitRpcTimeoutMultiplier()); + LOGGER.info( + "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); } if (this.clientProperties.getWaitMaxRpcTimeout() != null) { waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); + LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); } if (this.clientProperties.getWaitTotalTimeout() != null) { waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); + LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); } clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); RetrySettings.Builder blockRetrySettingBuilder = @@ -257,16 +350,23 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getBlockInitialRpcTimeout() != null) { blockRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getBlockInitialRpcTimeout()); + LOGGER.info( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); } if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { blockRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getBlockRpcTimeoutMultiplier()); + LOGGER.info( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); } if (this.clientProperties.getBlockMaxRpcTimeout() != null) { blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); + LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); } if (this.clientProperties.getBlockTotalTimeout() != null) { blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); + LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); } clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); RetrySettings.Builder collideNameRetrySettingBuilder = @@ -274,18 +374,28 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { collideNameRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollideNameInitialRpcTimeout()); + LOGGER.info( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); } if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + LOGGER.info( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); } if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { collideNameRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getCollideNameMaxRpcTimeout()); + LOGGER.info( + "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); } if (this.clientProperties.getCollideNameTotalTimeout() != null) { collideNameRetrySettingBuilder.setTotalTimeout( this.clientProperties.getCollideNameTotalTimeout()); + LOGGER.info( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); } clientSettingsBuilder .collideNameSettings() diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden index 2f227c825f..7018ac2e55 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden @@ -26,6 +26,8 @@ import com.google.showcase.v1beta1.EchoClient; import com.google.showcase.v1beta1.EchoSettings; import java.io.IOException; import javax.annotation.Generated; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -43,6 +45,7 @@ import org.threeten.bp.Duration; @EnableConfigurationProperties(EchoSpringProperties.class) public class EchoSpringAutoConfiguration { private final EchoSpringProperties clientProperties; + private static final Log LOGGER = LogFactory.getLog(EchoSpringAutoConfig.class); protected EchoSpringAutoConfiguration(EchoSpringProperties clientProperties) { this.clientProperties = clientProperties; @@ -74,6 +77,10 @@ public class EchoSpringAutoConfiguration { .setHeaderProvider(); if (this.clientProperties.getQuotaProjectId() != null) { clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + LOGGER.info( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); } if (this.clientProperties.getExecutorThreadCount() != null) { ExecutorProvider executorProvider = @@ -81,37 +88,51 @@ public class EchoSpringAutoConfiguration { .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) .build(); clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + LOGGER.info( + "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); } if (this.clientProperties.getUseRest()) { clientSettingsBuilder.setTransportChannelProvider( EchoSettings.defaultHttpJsonTransportProviderBuilder().build()); + LOGGER.info("Using HTTP transport channel"); } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { echoRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getEchoInitialRetryDelay()); + LOGGER.info( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); } if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { echoRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getEchoRetryDelayMultiplier()); + LOGGER.info( + "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); } if (this.clientProperties.getEchoMaxRetryDelay() != null) { echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); + LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); } if (this.clientProperties.getEchoInitialRpcTimeout() != null) { echoRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getEchoInitialRpcTimeout()); + LOGGER.info( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); } if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { echoRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getEchoRpcTimeoutMultiplier()); + LOGGER.info( + "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); } if (this.clientProperties.getEchoMaxRpcTimeout() != null) { echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); + LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); } if (this.clientProperties.getEchoTotalTimeout() != null) { echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); + LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); } clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); RetrySettings.Builder expandRetrySettingBuilder = @@ -119,27 +140,40 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getExpandInitialRetryDelay() != null) { expandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getExpandInitialRetryDelay()); + LOGGER.info( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); } if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { expandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getExpandRetryDelayMultiplier()); + LOGGER.info( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); } if (this.clientProperties.getExpandMaxRetryDelay() != null) { expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); + LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); } if (this.clientProperties.getExpandInitialRpcTimeout() != null) { expandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getExpandInitialRpcTimeout()); + LOGGER.info( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); } if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { expandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getExpandRpcTimeoutMultiplier()); + LOGGER.info( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getExpandMaxRpcTimeout() != null) { expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); + LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); } if (this.clientProperties.getExpandTotalTimeout() != null) { expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); + LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); } clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); RetrySettings.Builder collectRetrySettingBuilder = @@ -147,16 +181,23 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollectInitialRpcTimeout() != null) { collectRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollectInitialRpcTimeout()); + LOGGER.info( + "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); } if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { collectRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollectRpcTimeoutMultiplier()); + LOGGER.info( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); } if (this.clientProperties.getCollectMaxRpcTimeout() != null) { collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); + LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); } if (this.clientProperties.getCollectTotalTimeout() != null) { collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); + LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); } clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); RetrySettings.Builder chatRetrySettingBuilder = @@ -164,16 +205,22 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatInitialRpcTimeout() != null) { chatRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatInitialRpcTimeout()); + LOGGER.info( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); } if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { chatRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatRpcTimeoutMultiplier()); + LOGGER.info( + "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); } if (this.clientProperties.getChatMaxRpcTimeout() != null) { chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); + LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); } if (this.clientProperties.getChatTotalTimeout() != null) { chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); + LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); } clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); RetrySettings.Builder chatAgainRetrySettingBuilder = @@ -181,18 +228,28 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { chatAgainRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatAgainInitialRpcTimeout()); + LOGGER.info( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); } if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + LOGGER.info( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); } if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { chatAgainRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getChatAgainMaxRpcTimeout()); + LOGGER.info( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); } if (this.clientProperties.getChatAgainTotalTimeout() != null) { chatAgainRetrySettingBuilder.setTotalTimeout( this.clientProperties.getChatAgainTotalTimeout()); + LOGGER.info( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); } clientSettingsBuilder .chatAgainSettings() @@ -202,30 +259,48 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { pagedExpandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getPagedExpandInitialRetryDelay()); + LOGGER.info( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); } if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getPagedExpandRetryDelayMultiplier()); + LOGGER.info( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); } if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { pagedExpandRetrySettingBuilder.setMaxRetryDelay( this.clientProperties.getPagedExpandMaxRetryDelay()); + LOGGER.info( + "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); } if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getPagedExpandInitialRpcTimeout()); + LOGGER.info( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); } if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getPagedExpandMaxRpcTimeout()); + LOGGER.info( + "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); } if (this.clientProperties.getPagedExpandTotalTimeout() != null) { pagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getPagedExpandTotalTimeout()); + LOGGER.info( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); } clientSettingsBuilder .pagedExpandSettings() @@ -235,18 +310,30 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + LOGGER.info( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); } if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); } if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + LOGGER.info( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); } if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { simplePagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getSimplePagedExpandTotalTimeout()); + LOGGER.info( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); } clientSettingsBuilder .simplePagedExpandSettings() @@ -256,16 +343,22 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getWaitInitialRpcTimeout() != null) { waitRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getWaitInitialRpcTimeout()); + LOGGER.info( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); } if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { waitRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getWaitRpcTimeoutMultiplier()); + LOGGER.info( + "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); } if (this.clientProperties.getWaitMaxRpcTimeout() != null) { waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); + LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); } if (this.clientProperties.getWaitTotalTimeout() != null) { waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); + LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); } clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); RetrySettings.Builder blockRetrySettingBuilder = @@ -273,16 +366,23 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getBlockInitialRpcTimeout() != null) { blockRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getBlockInitialRpcTimeout()); + LOGGER.info( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); } if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { blockRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getBlockRpcTimeoutMultiplier()); + LOGGER.info( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); } if (this.clientProperties.getBlockMaxRpcTimeout() != null) { blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); + LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); } if (this.clientProperties.getBlockTotalTimeout() != null) { blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); + LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); } clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); RetrySettings.Builder collideNameRetrySettingBuilder = @@ -290,18 +390,28 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { collideNameRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollideNameInitialRpcTimeout()); + LOGGER.info( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); } if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + LOGGER.info( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); } if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { collideNameRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getCollideNameMaxRpcTimeout()); + LOGGER.info( + "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); } if (this.clientProperties.getCollideNameTotalTimeout() != null) { collideNameRetrySettingBuilder.setTotalTimeout( this.clientProperties.getCollideNameTotalTimeout()); + LOGGER.info( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); } clientSettingsBuilder .collideNameSettings()