I am using Intellj to run my Spring Boot application which has application.yml file with place holdersholder. The values of placeholder toshould be injected at run time depending upon the environment'senvironment configuration.
spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.urlserver: ${KAFKA_SCHEMA_REGISTRY} brokersport: ${KAFKA_BOOTSTRAP_SERVERSSERVER_PORT} I am trying to run the Spring Boot application from Intellij whileby passing the place holder valuesvalue in the below format:
![intellijEnvironment Variable section of application run configuration][1]
I am getting below error while running this application:
Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: **Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"** Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}"