Quarkus - Spring Cloud Config Client - quarkus

I am getting this error when trying to set header that has to be sent to Spring Config Server.
Unrecognized configuration key "quarkus.spring-cloud-config.headers" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
# application.properties
quarkus.spring-cloud-config.headers="access_token=12345"
I am not sure what I am doing wrong. Please help. Thanks in advance.

You need to use:
quarkus.spring-cloud-config.headers.access_token=12345

Related

getting Could not resolve placeholder while reading yml values in spring boot

I'm using spring boot and using this value in my application.yml
config:
username: abc
password: xyz
In my class, I'm utilizing it this way -
#Value("${config.username}")
private String username;
I'm getting the following error -
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'config.username' in value "${config.username}"
However if I use this in my application.yml file, it works. Can you please tell me what I'm doing wrong here?
config.username: abc
config.password: xyz
check your placeholder is Tab or Space ? make sure no Tab in your yml file.
was facing the same problem when trying to read from application.yml file instead of application.properties file. maven clean & then maven install resolved the issue for me.

logging.level.root doesn't work in springboot

I want to setting the default logging level to error on springboot
enter image description here
But the console still has the dubug and info output. It seems that logging.level.root=error doesn't work.
Be carefull if you are using Spring Boot Devtools, the properties defined in $HOME/.config/spring-boot folder will override all other properties as specified in Spring Boot documentation : https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html
I found a environment variable named debug,even though its value is a string not true,which caused the problem.Actually,I tried to remove the variable before,but I didn't restart the eclipse.Now,I remove the varibale named DEBUG and restart the eclipse,and it success.

Spring Boot yaml configuration doesn't load second key

I'm trying to create a config file in yaml for my Spring Boot project.
For a test I just setup some values:
user:
test: hello
Now I'm trying to get the information of user.test, but I get the error message Could not resolve placeholder 'user.test' in value "${user.test}"
The strange thing is, that if my config files just has user.test: hello, then everything works fine.
Is there something that I have to setup before to work with yml files as properties?

Spring Boot method entry and exit logging not working

I have the following entry in my application.yml for logging, but it's not logging the method entry and exit. It's only logging the Tomcat server log.
application.yml
logging:
file: ../logs/Audit_Management_DS.log
level: DEBUG
I am deploying my application on Tomcat 8. I have tried this through application.properties, but it's not working. My entry in application.properties is as follows:
logging.file= ../logs/Audit_Management_DS.log
logging.level.*=DEBUG
logging.level.org.springframework = ON
Your application.yml looks like it has whitespace errors, the '*' (asterisk) in your properties file probably should be "ROOT", and "ON" is not a valid log level. Fix some or all of those and see if it helps.
(But as the others said in comments, Spring Boot does not log method executions.)

Gradle can't resolve dependencies through my http proxy

when I try to run gradle dependencies on my computer I am getting a 407 status code "Proxy Authentication Required."
I created a gradle.properties file in my %GRADLE_HOME% directory. gradle.properties contains the following entries:
systemProp.proxySet='true'
systemProp.http.proxyHost=http-proxy.nwie.net
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=%myUserNameHere%
systemProp.http.proxyPassword=%myPasswordHere%
I can successfully get through my proxy for ruby gems by setting HTTP_PROXY to the following value:
http://%myUserNameHere%:%myPasswordHere%#http-proxy.nwie.net:8080
I am using gradle-1.3, please let me know if there is something I am missing.
Thanks in advance!
UPDATE:
I tried setting systemProp.http.proxyUser to a new value in domain/username format. Below are my current properties file contents:
systemProp.proxySet=true
systemProp.http.proxyHost=http-proxy.nwie.net
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=http-proxy.nwie.net/%USERNAME%
systemProp.http.proxyPassword=%PASSWORD%
I am currently getting the same error message I found initially.
Some dependencies are fetched from servers that run over HTTPS so you need to specify values for https properties as well:
systemProp.https.proxyHost=http-proxy.nwie.net
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=http-proxy.nwie.net/%USERNAME%
systemProp.https.proxyPassword=%PASSWORD%
Is it an NTLM proxy (Usually found in a windows environment with active directory). If so, You may have to specify the domain name with the username in the format domain/username.
Take a look at this link.
http://www.gradle.org/docs/current/userguide/build_environment.html

Resources