0

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?
Chi Zhang
  • 1
  • 1
  • Please share a [minimal reproducible project sample](https://stackoverflow.com/help/minimal-reproducible-example) to check whether it is a problem with the IDE or a project misconfiguration – Egor Klepikov Aug 21 '23 at 08:40
  • @EgorKlepikov I have added a snippet of my application.yaml with that field, please let me know if it's helpful. – Chi Zhang Aug 21 '23 at 18:30

1 Answers1

0

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

beyzanur
  • 28
  • 5
  • My application is deployed on GKE, so it's just using the default project-id and credential. The subscription-name is hardcoded in the application itself. Do they have to be in application.yaml? – Chi Zhang Aug 21 '23 at 18:25