Questions tagged [spring-boot-configuration]

100 questions
0
votes
0 answers

How to enforce parameter are not overwrite spring boot

Say I have spring boot base project that I want each developer to start from. I have a set of properties in my application.properties (some custom some are from spring) and I don't want any developer to remove or overwrite it when he/she starts…
user1409534
  • 2,140
  • 4
  • 27
  • 33
0
votes
1 answer

How to dynamically provide different .properties files for beans of same type?

Let's provide context, before I try to explain the need I'd want to meet. Class - AnimalShelterConfiguration @Configuration public class AnimalShelterConfiguration { @Bean public List animals(@Value("#{'${animals}'.split(',')}")…
0
votes
2 answers

Conditionnaly replace spring boot config yml property

I would like to replace a configuration yml property using a condition based on environnement variables : spring: datasource: username:${ENV} == 'PROD' ? ${USER_PROD} : ${USER_TEST} password: ${ENV} == 'PROD' ? ${PWD_PROD} :…
0
votes
1 answer

why application.yml doesn't work in my springboot

I am new to the springboot. I want to change the default port 8080 to 9001. Under the below image, I added a applicaton.yml, server: port: 9001 but it dosen't work. While I added in application.properties it works. My problem is my applicaton.yml…
Jiao
  • 111
  • 1
  • 3
0
votes
0 answers

How to validate Spring Boot's External Configuration used in Placeholders

I am aware of possibility to validate the external configuration of a Spring Boot configuration done by the help of configuration properties (@ConfigurationProperties) and bean validation. But how can I validate properties used in placeholders like…
Oliver
  • 3,815
  • 8
  • 35
  • 63
0
votes
0 answers

Write/Run Junit Test class (To test actuators) without Datasource bean creation in springboot container

What we are trying to do? Writing a Junit for Springboot actuator/Admin as below Code snippet: ActuatorTests.java @SpringBootTest(properties = { "management.endpoints.web.exposure.include=" }) @ActiveProfiles(profiles =…
0
votes
2 answers

Cannot override Spring Bean although CondionalOnMissingBean is present

I have this class in a library project: @ConditionalOnMissingBean(name = "myServiceActivator") @Component(value = "myServiceActivator") public class MyServiceActivator { @ServiceActivator(inputChannel = "SomeChannel") public void…
Hasan Can Saral
  • 2,950
  • 5
  • 43
  • 78
0
votes
1 answer

how we can configure spring boot application to store and retrieve java collections like lists and Date object in redis cache?

how we can configure spring boot application to store and retrieve java collections like lists and Date object in redis cache? Can anyone help me on this? Redis configuration in spring boot to store and retrieve objects stored in redis cache that…
0
votes
1 answer

loading springboot properties from a Json file using -Dspring.application.json

I am trying to run the springboot application using the below command and passing the properties using -Dspring.application.json *mvnw spring-boot:run -Dspring.application.json = "{"Api": {"gateway": {"password": "abc"}}}"* I tried using single…
0
votes
2 answers

@ConfigurationProperties, @Value not Working YET Passing the Tests

I have a strange problem reading configuration, none of solutions I've seen seem to work. Here is my code: @SpringBootApplication @EnableConfigurationProperties public class Application { public static void main(String[] args) { …
0
votes
0 answers

How do I get a custom configuration value available in @ConditionalOnExpression annotation

I am trying to have specific beans enabled based on the "functionality" for the deployment, such as a rest interface, a message consumer, an indexer, an archiver, and an admin portal. In some instances the app should have all, some or one of the…
0
votes
1 answer

Map in yaml file for @ConfirgurationProperties in java?

Hello I have a configuration class in a spring boot project that looks something like this . @ConfigurationProperties(config.value) public class ApplicationProperties{ Map userProperties; } …
Anuja Barve
  • 300
  • 1
  • 4
  • 23
0
votes
3 answers

How to override SpringBoot config external file to classpath file?

I would like override SpringBoot external's some config into classpath file., when I run jar by command line. classpath -> application-config.yaml (Not application.yaml) server: port: 8080 servlet: contextPath: /myapp test-message: this…
Zaw Than oo
  • 9,651
  • 13
  • 83
  • 131
0
votes
1 answer

Referencing configuration section from other place in spring-boot application.yaml

I'm configuring spring boot kafka streams in application.yaml. I need to configure properties of the output topics: producer: topic.properties: cleanup.policy: compact retention.ms: 604800000 Because I have the same configuration across…
Masáč
  • 163
  • 1
  • 5
0
votes
1 answer

How to enable Spring Boot to connect to external API

I'm developing a Spring Boot application behind a Proxy server. Now I need to connect to an external API but I didn't figure out yet what to configure in order to enable the application to connect to the outside API, I already tried to pass the…