Kumar Reddy
Kumar Reddy

Reputation: 21

Pub/Sub Implementation in Spring boot

Currently in our project we already implemented firebase messaging service(FCM).We already have service account created for this. Now we need to implement a pub/sub with different google and service account. When I try to implement this its taking default credentials.

How can we configure different service account credentials for FCM and pub/sub?

Kindly let me know how can we fix this.

default credentials

Dependencies added

Error I am facing

Upvotes: 1

Views: 1405

Answers (1)

Elena Felder
Elena Felder

Reputation: 466

To explicitly provide credentials for Spring Cloud GCP Pub/Sub, use the spring.cloud.gcp.pubsub.credentials.location or spring.cloud.gcp.pubsub.credentials.encoded-key property.

Documentation available here.

The error you have is unrelated to GCP authentication, though -- the issue is that two different starters are defining a Jwt parsing bean. If you don't need to extract identity from Firebase, then it can be turned off with spring.cloud.gcp.security.firebase.enabled=false. If you do need it, and com.magilhub is under your control, follow the Spring Boot suggestion and use @Qualifier to get the specific one you need.

Upvotes: 1

Related Questions