Firebase Messaging throws exception and can not reconnect
MohamedFadhl opened this issue · 2 comments
have a system built with spring boot, java 8 and hosted on google cloud using compute engine.
My server app is Wildfly 21.0.1.Final.
I am using Firebase messaging to deliver notifications to the application users.
The service is working fine most of the time, however, I get this error from time to time.
com.google.firebase.messaging.FirebaseMessagingException: Failed to establish a connection: Error getting access token for service account: IP_OF_PROXY_HOST_GOES_HERE, iss: firebase-adminsdk-project@projectname.iam.gserviceaccount.com
As a workaround, I do a full server (Wildfly) restart to get the service back.
In my pom file, I have:
com.google.firebase
firebase-admin
9.1.1
com.google.api-client
google-api-client-bom
2.2.0
I have searched for similar issues and checked:
1- The system clock is synchronized
2- Firewall access to Firebase
3- The service works well and the issue happens randomly from time to time.
4- I can not reproduce since I don't know the cause.
Note: I don't use any other Google service for this product.
I think that the issue is with the authorization API it works for a while then, it couldn't reconnect again.
Did anyone face the same and found a fix?
Memo: FirebaseMessagingException is in https://github.com/firebase/firebase-admin-java/blob/master/src/main/java/com/google/firebase/messaging/FirebaseMessagingException.java.
@MohamedFadhl Would you create an issue in https://github.com/firebase/firebase-admin-java?
I see you created one already firebase/firebase-admin-java#794. Closing this issue.