IntelliJ shows "Cannot resolve configuration property" error for Spring Cloud GCP PubSub configuration

203 views Asked by At

My Spring Boot application depends on Spring Cloud GCP PubSub, with maven dependency specified as below:

    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
      <version>3.4.0</version>
    </dependency>

When I configured for it in application.yaml based on its doc at https://googlecloudplatform.github.io/spring-cloud-gcp/3.4.0/reference/html/index.html#cloud-pubsub, my IntelliJ shows "the configuration property is not found", see screenshot

Below is a snippet of my applcation.yaml file:

spring:
  application:
    name: cat-service
  cloud:
    gcp:
      pubsub:
        subscriber:
          min-duration-per-ack-extension: 300 # 5 minutes
    kubernetes:
      loadbalancer:
        mode: service
      reload:
        enabled: true
        mode: polling
        period: 5000
      config:
        sources:
        - name: ${spring.application.name}
    loadbalancer:
      ribbon:
        enabled: false

My questions are:

  1. How do I tell whether it's a real configuration error (e.g. the dependency does not support this config property), or is it something wrong with IntelliJ?
  2. How do I get rid of this error?
1

There are 1 answers

1
beyzanur On

Did you try to add project-id, subscription-name and credentials to your application.yaml?