GoogleCloudPlatform / spring-cloud-gcp

New home for Spring Cloud GCP development starting with version 2.0.
Apache License 2.0
419 stars 312 forks source link

Option to disable topic existence verification in the Spring Cloud GCP Pub/Sub Binder #3098

Open burkedavison opened 2 months ago

burkedavison commented 2 months ago

When Spring Cloud Stream calls provisionConsumerDestination and provisionProducerDestination on the Spring Cloud GCP PubSubChannelProvisioner, the method ensureTopicExists is called and invokes pubsubAdmin.getTopic. This can cause GCP quota issues if it occurs too often.

Workaround: Increase spring.cloud.stream.dynamic-destination-cache-size. (Add'l documentation)

Feature Request: As an alternative, Spring Cloud GCP could provide some mechanism to optionally disable topic existence verification in the Spring Cloud GCP Pub/Sub Binder implementation.

smahieu87 commented 2 months ago

We had the same issue but for us the SA didn't have view access on the topic. To resolve our issue we just set the auto-create-resources to false and it doesn't do the ensureTopicExists anymore for the consumer part. Would be nice if the same was possibility for option for the producer part.