Spring cloud stream with GCP Pubsub - disable check for existing topic

Viewed 537

I have a PubSub subscription in GCP Project A, and a Spring Cloud Stream app running in A.

That PubSub subscription in A references a Topic foo in GCP Project B. That application currently has only access to that subscription (but not to that topic in B). AFAIK this should be a valid config.

However, it seems that PubSubChannelProvisioner wants to make sure that the topic exists, and throws an exception:

Failed to create consumer binding; retrying in 30 seconds org.springframework.cloud.stream.provisioning.ProvisioningException: Non-existing 'projects/A/topics/foo' topic. at org.springframework.cloud.gcp.stream.binder.pubsub.provisioning.PubSubChannelProvisioner.makeSureTopicExists(PubSubChannelProvisioner.java:124) at

Is there an option to disable that? Or is it necessary to give that app access to Topic foo in A?

1 Answers

That is a valid topic and subscription config. However, there currently isn't a way to disable the topic existence check in PubSubChannelProvider. Could you open an issue for this on the spring-cloud-gcp repository?

Related