I want to deploy a FCM XMPP app on Google AppEngine. I'm using this library https://github.com/thelong1EU/fcmxmppserver but I'm new on this backend side so I need some help. I managed to deploy it but it doesn't run. I don't know how to make the AppEngine call the main funtion here:
public class EntryPoint {
public static void main(String[] args) {
final String fcmProjectSenderId = senderID;
final String fcmServerKey = key;
CcsClient ccsClient = CcsClient.prepareClient(fcmProjectSenderId, fcmServerKey, false);
try {
ccsClient.connect();
} catch (XMPPException e) {
e.printStackTrace();
}
}
}
If i run just this function it all works well, but when deployed it doesn't start. What am I missing?
So I found out reading this:
https://cloud.google.com/appengine/docs/standard/java/an-overview-of-app-engine#scaling_types_and_instance_classes
When the app load it does a GET to
/_ah/stop
so I needed to add this to my servlet mapping. I did it like this:And the in the doGet() I do this:
I don't know if this is the recommended way but it works for now. If I find something else I will post.