From e836d2c225e8f42a3e7b319dfbb48fcd4cdcf73d Mon Sep 17 00:00:00 2001 From: Steve Hu Date: Mon, 19 Oct 2020 09:22:25 -0400 Subject: [PATCH 1/2] fixes #471 add appStatusYml to the codegen to allow users to separate the error codes --- .../codegen/graphql/GraphqlGenerator.java | 5 + .../templates/graphql/appStatusYml.rocker.raw | 18 ++++ .../templates/graphql/values.rocker.raw | 100 ++++++++++++++++++ .../codegen/hybrid/HybridServerGenerator.java | 5 + .../hybrid/HybridServiceGenerator.java | 4 + .../templates/hybrid/appStatusYml.rocker.raw | 18 ++++ .../templates/hybrid/values.rocker.raw | 100 ++++++++++++++++++ .../codegen/rest/OpenApiGenerator.java | 11 +- .../codegen/rest/OpenApiKotlinGenerator.java | 11 +- .../templates/rest/appStatusYml.rocker.raw | 18 ++++ .../restkotlin/appStatusYml.rocker.raw | 18 ++++ 11 files changed, 294 insertions(+), 14 deletions(-) create mode 100644 light-graphql-4j/src/main/resources/templates/graphql/appStatusYml.rocker.raw create mode 100644 light-graphql-4j/src/main/resources/templates/graphql/values.rocker.raw create mode 100644 light-hybrid-4j/src/main/resources/templates/hybrid/appStatusYml.rocker.raw create mode 100644 light-hybrid-4j/src/main/resources/templates/hybrid/values.rocker.raw create mode 100644 light-rest-4j/src/main/resources/templates/rest/appStatusYml.rocker.raw create mode 100644 light-rest-4j/src/main/resources/templates/restkotlin/appStatusYml.rocker.raw diff --git a/light-graphql-4j/src/main/java/com/networknt/codegen/graphql/GraphqlGenerator.java b/light-graphql-4j/src/main/java/com/networknt/codegen/graphql/GraphqlGenerator.java index 63ad05dbe..084a56d91 100644 --- a/light-graphql-4j/src/main/java/com/networknt/codegen/graphql/GraphqlGenerator.java +++ b/light-graphql-4j/src/main/java/com/networknt/codegen/graphql/GraphqlGenerator.java @@ -91,6 +91,11 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep transfer(targetPath, ("src.main.resources.config").replace(".", separator), "primary.crt", templates.graphql.primaryCrt.template()); transfer(targetPath, ("src.main.resources.config").replace(".", separator), "secondary.crt", templates.graphql.secondaryCrt.template()); + // added with #471 + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "app-status.yml", templates.graphql.appStatusYml.template()); + // values.yml file, transfer to suppress the warning message during start startup and encourage usage. + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.graphql.values.template()); + // logging transfer(targetPath, ("src.main.resources").replace(".", separator), "logback.xml", templates.graphql.logback.template()); transfer(targetPath, ("src.test.resources").replace(".", separator), "logback-test.xml", templates.graphql.logback.template()); diff --git a/light-graphql-4j/src/main/resources/templates/graphql/appStatusYml.rocker.raw b/light-graphql-4j/src/main/resources/templates/graphql/appStatusYml.rocker.raw new file mode 100644 index 000000000..27dbd0202 --- /dev/null +++ b/light-graphql-4j/src/main/resources/templates/graphql/appStatusYml.rocker.raw @@ -0,0 +1,18 @@ +# Put your application specific error code into this file instead of status.yml +# This file will be merge into the status.yml during the server startup. +# Please allocate the range for the application error codes within your organization +# to ensure no reused for an error code across the organization for tracing. + +# 20000-29999 common error codes within your business domain. +# It is highly recommended to have common error codes shared within your organization +# or your line of business and put them into the externalized status.yml file. + +# 30000-99999 customize error code that cannot be found in common range. +# Only use this section if you cannot make your error code into 20000-29999 range on time. +# In this case, the error code defined here will be merged to the status.yml during startup. +# To ensure there is no reuse of error code, this application will use the range 30000-31000. +ERR30000: + statusCode: 400 + code: ERR30000 + message: FIRST_ERROR_IN_APP + description: This is is the first error in this example application. diff --git a/light-graphql-4j/src/main/resources/templates/graphql/values.rocker.raw b/light-graphql-4j/src/main/resources/templates/graphql/values.rocker.raw new file mode 100644 index 000000000..9c9d9a37c --- /dev/null +++ b/light-graphql-4j/src/main/resources/templates/graphql/values.rocker.raw @@ -0,0 +1,100 @@ +#-------------------------------------------------------------------------------- +# values.yml : Set of values commonly overridden in microservices +# The file can be extended with other elements, as necessary +#-------------------------------------------------------------------------------- + +#-------------------------------------------------------------------------------- +# client.yml +#-------------------------------------------------------------------------------- +# key distribution server url +# client.server_url: set-real-value-here +# client_id used to access key distribution service. It can be the same client_id with token service or not. +# client.client_id: set-real-value-here + +#-------------------------------------------------------------------------------- +# server.yml +#-------------------------------------------------------------------------------- +# Https port if enableHttps is true. It will be ignored if dynamicPort is true +# server.httpsPort: 8443 + +# Enable HTTPS should be true on official environment and most dev environments. +# server.enableHttps: true + +# Http/2 is enabled by default for better performance and it works with the client module. +# server.enableHttp2: true + +# Minimum port range. This define a range for the dynamic allocated ports so that it is easier to setup +# firewall rule to enable this range. Default 2400 to 2500 block has 100 port numbers and should be +# enough for most cases unless you are using a big bare metal box as Kubernetes node that can run 1000s pods +server.minPort: 2400 + +# Maximum port rang. The range can be customized to adopt your network security policy and can be increased or +# reduced to ease firewall rules. +server.maxPort: 2500 + +# environment tag that will be registered on consul to support multiple instances per env for testing. +# https://github.com/networknt/light-doc/blob/master/docs/content/design/env-segregation.md +# This tag should only be set for testing env, not production. The production certification process will enforce it. +server.environment: dev + +# Build number, to be set by teams for auditing purposes. +# Allows teams to audit the value and set it according to their release management processes +server.buildNumber: latest + +#-------------------------------------------------------------------------------- +# security.yml +#-------------------------------------------------------------------------------- +# Enable JWT verification flag. +# security.enableVerifyJwt: true + +#-------------------------------------------------------------------------------- +# datasource.yml +#-------------------------------------------------------------------------------- +# datasource.jdbcUrl: set-real-value-here +# datasource.username: set-real-value-here + +# datasource.maximumPoolSize: set-real-value-here +# datasource.prepStmtCacheSize: set-real-value-here +# datasource.prepStmtCacheSqlLimit: set-real-value-here +# datasource.conectionTimeout: set-real-value-here + +#-------------------------------------------------------------------------------- +# secret.yml +#-------------------------------------------------------------------------------- +# Sever section +# Key store password, the path of keystore is defined in server.yml +# secret.serverKeystorePass: set-real-value-here +# Key password, the key is in keystore +# secret.serverKeyPass: set-real-value-here +# Trust store password, the path of truststore is defined in server.yml +# secret.serverTruststorePass: set-real-value-here + +# Client section +# Key store password, the path of keystore is defined in server.yml +# secret.clientKeystorePass: set-real-value-here +# Key password, the key is in keystore +# secret.clientKeyPass: set-real-value-here +# Trust store password, the path of truststore is defined in server.yml +# secret.clientTruststorePass: set-real-value-here +# Authorization code client secret for OAuth2 server +# secret.authorizationCodeClientSecret: set-real-value-here +# Client credentials client secret for OAuth2 server +# secret.clientCredentialsClientSecret: set-real-value-here +# Fresh token client secret for OAuth2 server +# secret.refreshTokenClientSecret: set-real-value-here +# Key distribution client secret for OAuth2 server +# secret.keyClientSecret: set-real-value-here + +# Consul section +# Consul Token for service registry and discovery +# secret.consulToken: set-real-value-here + +# EmailSender password +# secret.emailPassword: set-real-value-here + +# Database Section +# secret.mysqlDatabasePassword: set-real-value-here +# secret.oracleDatabasePassword: set-real-value-here + +# Service Singletons +service.singletons: diff --git a/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServerGenerator.java b/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServerGenerator.java index 8c1fbdda4..b5ac164b3 100644 --- a/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServerGenerator.java +++ b/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServerGenerator.java @@ -103,6 +103,11 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep transfer(targetPath, ("src.main.resources").replace(".", separator), "logback.xml", templates.hybrid.logback.template()); transfer(targetPath, ("src.test.resources").replace(".", separator), "logback-test.xml", templates.hybrid.logback.template()); + // added with #471 + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "app-status.yml", templates.hybrid.appStatusYml.template()); + // values.yml file, transfer to suppress the warning message during start startup and encourage usage. + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.hybrid.values.template()); + // transfer binary files without touching them. try (InputStream is = HybridServerGenerator.class.getResourceAsStream("/binaries/server.keystore")) { Files.copy(is, Paths.get(targetPath, ("src.main.resources.config").replace(".", separator), "server.keystore"), StandardCopyOption.REPLACE_EXISTING); diff --git a/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServiceGenerator.java b/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServiceGenerator.java index 1e26a2058..b3b4974f0 100644 --- a/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServiceGenerator.java +++ b/light-hybrid-4j/src/main/java/com/networknt/codegen/hybrid/HybridServiceGenerator.java @@ -85,6 +85,10 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep // logging transfer(targetPath, ("src.main.resources").replace(".", separator), "logback.xml", templates.hybrid.logback.template()); transfer(targetPath, ("src.test.resources").replace(".", separator), "logback-test.xml", templates.hybrid.logback.template()); + // added with #471 + transfer(targetPath, ("src.test.resources.config").replace(".", separator), "app-status.yml", templates.hybrid.appStatusYml.template()); + // values.yml file, transfer to suppress the warning message during start startup and encourage usage. + transfer(targetPath, ("src.test.resources.config").replace(".", separator), "values.yml", templates.hybrid.values.template()); // handler Map services = new HashMap(); diff --git a/light-hybrid-4j/src/main/resources/templates/hybrid/appStatusYml.rocker.raw b/light-hybrid-4j/src/main/resources/templates/hybrid/appStatusYml.rocker.raw new file mode 100644 index 000000000..27dbd0202 --- /dev/null +++ b/light-hybrid-4j/src/main/resources/templates/hybrid/appStatusYml.rocker.raw @@ -0,0 +1,18 @@ +# Put your application specific error code into this file instead of status.yml +# This file will be merge into the status.yml during the server startup. +# Please allocate the range for the application error codes within your organization +# to ensure no reused for an error code across the organization for tracing. + +# 20000-29999 common error codes within your business domain. +# It is highly recommended to have common error codes shared within your organization +# or your line of business and put them into the externalized status.yml file. + +# 30000-99999 customize error code that cannot be found in common range. +# Only use this section if you cannot make your error code into 20000-29999 range on time. +# In this case, the error code defined here will be merged to the status.yml during startup. +# To ensure there is no reuse of error code, this application will use the range 30000-31000. +ERR30000: + statusCode: 400 + code: ERR30000 + message: FIRST_ERROR_IN_APP + description: This is is the first error in this example application. diff --git a/light-hybrid-4j/src/main/resources/templates/hybrid/values.rocker.raw b/light-hybrid-4j/src/main/resources/templates/hybrid/values.rocker.raw new file mode 100644 index 000000000..9c9d9a37c --- /dev/null +++ b/light-hybrid-4j/src/main/resources/templates/hybrid/values.rocker.raw @@ -0,0 +1,100 @@ +#-------------------------------------------------------------------------------- +# values.yml : Set of values commonly overridden in microservices +# The file can be extended with other elements, as necessary +#-------------------------------------------------------------------------------- + +#-------------------------------------------------------------------------------- +# client.yml +#-------------------------------------------------------------------------------- +# key distribution server url +# client.server_url: set-real-value-here +# client_id used to access key distribution service. It can be the same client_id with token service or not. +# client.client_id: set-real-value-here + +#-------------------------------------------------------------------------------- +# server.yml +#-------------------------------------------------------------------------------- +# Https port if enableHttps is true. It will be ignored if dynamicPort is true +# server.httpsPort: 8443 + +# Enable HTTPS should be true on official environment and most dev environments. +# server.enableHttps: true + +# Http/2 is enabled by default for better performance and it works with the client module. +# server.enableHttp2: true + +# Minimum port range. This define a range for the dynamic allocated ports so that it is easier to setup +# firewall rule to enable this range. Default 2400 to 2500 block has 100 port numbers and should be +# enough for most cases unless you are using a big bare metal box as Kubernetes node that can run 1000s pods +server.minPort: 2400 + +# Maximum port rang. The range can be customized to adopt your network security policy and can be increased or +# reduced to ease firewall rules. +server.maxPort: 2500 + +# environment tag that will be registered on consul to support multiple instances per env for testing. +# https://github.com/networknt/light-doc/blob/master/docs/content/design/env-segregation.md +# This tag should only be set for testing env, not production. The production certification process will enforce it. +server.environment: dev + +# Build number, to be set by teams for auditing purposes. +# Allows teams to audit the value and set it according to their release management processes +server.buildNumber: latest + +#-------------------------------------------------------------------------------- +# security.yml +#-------------------------------------------------------------------------------- +# Enable JWT verification flag. +# security.enableVerifyJwt: true + +#-------------------------------------------------------------------------------- +# datasource.yml +#-------------------------------------------------------------------------------- +# datasource.jdbcUrl: set-real-value-here +# datasource.username: set-real-value-here + +# datasource.maximumPoolSize: set-real-value-here +# datasource.prepStmtCacheSize: set-real-value-here +# datasource.prepStmtCacheSqlLimit: set-real-value-here +# datasource.conectionTimeout: set-real-value-here + +#-------------------------------------------------------------------------------- +# secret.yml +#-------------------------------------------------------------------------------- +# Sever section +# Key store password, the path of keystore is defined in server.yml +# secret.serverKeystorePass: set-real-value-here +# Key password, the key is in keystore +# secret.serverKeyPass: set-real-value-here +# Trust store password, the path of truststore is defined in server.yml +# secret.serverTruststorePass: set-real-value-here + +# Client section +# Key store password, the path of keystore is defined in server.yml +# secret.clientKeystorePass: set-real-value-here +# Key password, the key is in keystore +# secret.clientKeyPass: set-real-value-here +# Trust store password, the path of truststore is defined in server.yml +# secret.clientTruststorePass: set-real-value-here +# Authorization code client secret for OAuth2 server +# secret.authorizationCodeClientSecret: set-real-value-here +# Client credentials client secret for OAuth2 server +# secret.clientCredentialsClientSecret: set-real-value-here +# Fresh token client secret for OAuth2 server +# secret.refreshTokenClientSecret: set-real-value-here +# Key distribution client secret for OAuth2 server +# secret.keyClientSecret: set-real-value-here + +# Consul section +# Consul Token for service registry and discovery +# secret.consulToken: set-real-value-here + +# EmailSender password +# secret.emailPassword: set-real-value-here + +# Database Section +# secret.mysqlDatabasePassword: set-real-value-here +# secret.oracleDatabasePassword: set-real-value-here + +# Service Singletons +service.singletons: diff --git a/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiGenerator.java b/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiGenerator.java index c0fa94eaa..f342993d2 100644 --- a/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiGenerator.java +++ b/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiGenerator.java @@ -109,8 +109,6 @@ public void generate(final String targetPath, Object model, Any config) throws I specChangeCodeReGenOnly = config.toBoolean("specChangeCodeReGenOnly"); enableParamDescription = config.toBoolean("enableParamDescription"); skipPomFile = config.toBoolean("skipPomFile"); - - generateValuesYml = config.toBoolean("generateValuesYml"); String artifactId = config.toString("artifactId"); String version = config.toString("version").trim(); String serviceId = config.get("groupId").toString().trim() + "." + artifactId.trim() + "-" + config.get("version").toString().trim(); @@ -203,11 +201,10 @@ public void generate(final String targetPath, Object model, Any config) throws I transfer(targetPath, ("src.main.resources.config").replace(".", separator), "sanitizer.yml", templates.rest.sanitizerYml.template()); transfer(targetPath, ("src.main.resources.config").replace(".", separator), "traceability.yml", templates.rest.traceabilityYml.template()); transfer(targetPath, ("src.main.resources.config").replace(".", separator), "health.yml", templates.rest.healthYml.template()); - - // values.yml file, transfer only if explicitly set in the config.json - if (generateValuesYml) { - transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.rest.openapi.values.template()); - } + // added with #471 + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "app-status.yml", templates.rest.appStatusYml.template()); + // values.yml file, transfer to suppress the warning message during start startup and encourage usage. + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.rest.openapi.values.template()); } // routing handler transfer(targetPath, ("src.main.resources.config").replace(".", separator), "handler.yml", diff --git a/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiKotlinGenerator.java b/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiKotlinGenerator.java index 56f9e38d9..e0c4bac2d 100644 --- a/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiKotlinGenerator.java +++ b/light-rest-4j/src/main/java/com/networknt/codegen/rest/OpenApiKotlinGenerator.java @@ -104,9 +104,6 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep skipServerInfo = config.toBoolean("skipServerInfo"); regenerateCodeOnly = config.toBoolean("specChangeCodeReGenOnly"); enableParamDescription = config.toBoolean("enableParamDescription"); - - generateValuesYml = config.toBoolean("generateValuesYml"); - String version = config.toString("version").trim(); String serviceId = config.get("groupId").toString().trim() + "." + config.get("artifactId").toString().trim() + "-" + config.get("version").toString().trim(); @@ -171,10 +168,10 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep // exclusion list for Config module transfer(targetPath, ("src.main.resources.config").replace(".", separator), "config.yml", templates.restkotlin.openapi.config.template()); - - // values.yml file, transfer only if explicitly set in the config.json - if(generateValuesYml) - transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.restkotlin.openapi.values.template()); + // added with #471 + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "app-status.yml", templates.restkotlin.appStatusYml.template()); + // values.yml file, transfer to suppress the warning message during start startup and encourage usage. + transfer(targetPath, ("src.main.resources.config").replace(".", separator), "values.yml", templates.restkotlin.openapi.values.template()); } } diff --git a/light-rest-4j/src/main/resources/templates/rest/appStatusYml.rocker.raw b/light-rest-4j/src/main/resources/templates/rest/appStatusYml.rocker.raw new file mode 100644 index 000000000..27dbd0202 --- /dev/null +++ b/light-rest-4j/src/main/resources/templates/rest/appStatusYml.rocker.raw @@ -0,0 +1,18 @@ +# Put your application specific error code into this file instead of status.yml +# This file will be merge into the status.yml during the server startup. +# Please allocate the range for the application error codes within your organization +# to ensure no reused for an error code across the organization for tracing. + +# 20000-29999 common error codes within your business domain. +# It is highly recommended to have common error codes shared within your organization +# or your line of business and put them into the externalized status.yml file. + +# 30000-99999 customize error code that cannot be found in common range. +# Only use this section if you cannot make your error code into 20000-29999 range on time. +# In this case, the error code defined here will be merged to the status.yml during startup. +# To ensure there is no reuse of error code, this application will use the range 30000-31000. +ERR30000: + statusCode: 400 + code: ERR30000 + message: FIRST_ERROR_IN_APP + description: This is is the first error in this example application. diff --git a/light-rest-4j/src/main/resources/templates/restkotlin/appStatusYml.rocker.raw b/light-rest-4j/src/main/resources/templates/restkotlin/appStatusYml.rocker.raw new file mode 100644 index 000000000..27dbd0202 --- /dev/null +++ b/light-rest-4j/src/main/resources/templates/restkotlin/appStatusYml.rocker.raw @@ -0,0 +1,18 @@ +# Put your application specific error code into this file instead of status.yml +# This file will be merge into the status.yml during the server startup. +# Please allocate the range for the application error codes within your organization +# to ensure no reused for an error code across the organization for tracing. + +# 20000-29999 common error codes within your business domain. +# It is highly recommended to have common error codes shared within your organization +# or your line of business and put them into the externalized status.yml file. + +# 30000-99999 customize error code that cannot be found in common range. +# Only use this section if you cannot make your error code into 20000-29999 range on time. +# In this case, the error code defined here will be merged to the status.yml during startup. +# To ensure there is no reuse of error code, this application will use the range 30000-31000. +ERR30000: + statusCode: 400 + code: ERR30000 + message: FIRST_ERROR_IN_APP + description: This is is the first error in this example application. From 4b7552851856187b0cf1aeea15d37b8edaf28dcc Mon Sep 17 00:00:00 2001 From: Steve Hu Date: Mon, 19 Oct 2020 09:28:15 -0400 Subject: [PATCH 2/2] fixes #470 add injectCallerId to the client.yml --- .../src/main/resources/templates/graphql/clientYml.rocker.raw | 2 ++ .../src/main/resources/templates/hybrid/clientYml.rocker.raw | 2 ++ .../src/main/resources/templates/rest/clientYml.rocker.raw | 2 ++ .../main/resources/templates/restkotlin/clientYml.rocker.raw | 2 ++ 4 files changed, 8 insertions(+) diff --git a/light-graphql-4j/src/main/resources/templates/graphql/clientYml.rocker.raw b/light-graphql-4j/src/main/resources/templates/graphql/clientYml.rocker.raw index cb51896bd..5b45194df 100644 --- a/light-graphql-4j/src/main/resources/templates/graphql/clientYml.rocker.raw +++ b/light-graphql-4j/src/main/resources/templates/graphql/clientYml.rocker.raw @@ -159,6 +159,8 @@ request: resetTimeout: ${client.resetTimeout:7000} # if open tracing is enable. traceability, correlation and metrics should not be in the chain if opentracing is used. injectOpenTracing: ${client.injectOpenTracing:false} + # inject serviceId as callerId into the http header for metrics to collect the caller. The serviceId is from server.yml + injectCallerId: ${client.injectCallerId:false} # the flag to indicate whether http/2 is enabled when calling client.callService() enableHttp2: ${client.enableHttp2:true} # the maximum host capacity of connection pool diff --git a/light-hybrid-4j/src/main/resources/templates/hybrid/clientYml.rocker.raw b/light-hybrid-4j/src/main/resources/templates/hybrid/clientYml.rocker.raw index be555154c..0ddf534c8 100644 --- a/light-hybrid-4j/src/main/resources/templates/hybrid/clientYml.rocker.raw +++ b/light-hybrid-4j/src/main/resources/templates/hybrid/clientYml.rocker.raw @@ -159,6 +159,8 @@ request: resetTimeout: ${client.resetTimeout:7000} # if open tracing is enable. traceability, correlation and metrics should not be in the chain if opentracing is used. injectOpenTracing: ${client.injectOpenTracing:false} + # inject serviceId as callerId into the http header for metrics to collect the caller. The serviceId is from server.yml + injectCallerId: ${client.injectCallerId:false} # the flag to indicate whether http/2 is enabled when calling client.callService() enableHttp2: ${client.enableHttp2:true} # the maximum host capacity of connection pool diff --git a/light-rest-4j/src/main/resources/templates/rest/clientYml.rocker.raw b/light-rest-4j/src/main/resources/templates/rest/clientYml.rocker.raw index cb51896bd..5b45194df 100644 --- a/light-rest-4j/src/main/resources/templates/rest/clientYml.rocker.raw +++ b/light-rest-4j/src/main/resources/templates/rest/clientYml.rocker.raw @@ -159,6 +159,8 @@ request: resetTimeout: ${client.resetTimeout:7000} # if open tracing is enable. traceability, correlation and metrics should not be in the chain if opentracing is used. injectOpenTracing: ${client.injectOpenTracing:false} + # inject serviceId as callerId into the http header for metrics to collect the caller. The serviceId is from server.yml + injectCallerId: ${client.injectCallerId:false} # the flag to indicate whether http/2 is enabled when calling client.callService() enableHttp2: ${client.enableHttp2:true} # the maximum host capacity of connection pool diff --git a/light-rest-4j/src/main/resources/templates/restkotlin/clientYml.rocker.raw b/light-rest-4j/src/main/resources/templates/restkotlin/clientYml.rocker.raw index cb51896bd..5b45194df 100644 --- a/light-rest-4j/src/main/resources/templates/restkotlin/clientYml.rocker.raw +++ b/light-rest-4j/src/main/resources/templates/restkotlin/clientYml.rocker.raw @@ -159,6 +159,8 @@ request: resetTimeout: ${client.resetTimeout:7000} # if open tracing is enable. traceability, correlation and metrics should not be in the chain if opentracing is used. injectOpenTracing: ${client.injectOpenTracing:false} + # inject serviceId as callerId into the http header for metrics to collect the caller. The serviceId is from server.yml + injectCallerId: ${client.injectCallerId:false} # the flag to indicate whether http/2 is enabled when calling client.callService() enableHttp2: ${client.enableHttp2:true} # the maximum host capacity of connection pool