0

So it's possible to deploy java web applications to Google App Engine (GAE) but how could I host a standard java app on GAE? I've written an application for my company that have to be running 24/7, the application basically monitors the inbox of a specific email and does the required handling.

Is it possible to port such an app to a web application that can be deployed on GAE? Or is GAE only designed for RESTful apps?

If this is not possible through GAE, should we give Google Compute Engine a look?

4
  • 2
    What's a standard java app? Is it some kind of desktop app with a GUI? It's definitely possible to implement what you're describing with GAE alone (cron jobs, tasks, etc) but it's not intended to simply host apps that were not developed with GAE in mind. You would likely need to completely rewrite the app so it runs in GAE or simply take a look at GCE (or other IaaS') as you suggested yourself. Commented Jul 28, 2015 at 9:56
  • Excuse me for the lack of elaboration, I meant a command line java application that I run via the java binary/command. The app uses java libraries like JavaMail. Commented Jul 28, 2015 at 10:33
  • Yeah, even with the command line app, the same things apply, you would either need to rewrite parts of your app so it runs in GAE or likely not make any changes and simply run it in GCE. Commented Jul 28, 2015 at 10:41
  • Thanks for the info Mihail :) Commented Jul 28, 2015 at 10:50

1 Answer 1

3

It's possible to port this app to GAE, but you'll need to do some additional work - such as setting up a scheduled task using Cron so that the logic of your application would be executed regularly.

With Google Compute Engine, it's likely that you'll be able to simply run the application without many modifications, but you'll likely spend more effort on setting up and maintaining the GCE VM on which your application runs.

Sign up to request clarification or add additional context in comments.

5 Comments

When I run the app on a desktop machine, the app keeps running (monitoring) until I shut it down. I don't want to execute the logic every X amount of time. The app have to stay running at all times. Is this still possible with Cron? If all of this is still possible, the app is designed to create several threads as needed, is this an issue? I need to know this as to help the company decide what better (GAE or GCE) suits their needs.
If the app is monitoring a mailbox, then it essentially runs a loop checking the contents of the mailbox. If you set up a Cron job to check the contents of the mailbox every 1 second, the effect will be the same as running your code in a loop.
GAE also has certain restrictions on creating threads. You can read more about those restrictions here.
The app fetches unread emails on launch and handle them, then it issues an IMAP IDLE command on the Inbox folder, this in effect keeps a connection open between the app and the server, through this connection the server notifies the app of any new mail as soon as it arrives. To keep on topic, according to what you explained, the logic of the app have to be changed so it just checks unread emails every X amount of time (via Cron), ditching the whole IDLE thing. Thanks for the information it really helped.
Ah OK. For this kind of application, I would simply use GCE, because keeping the open connection requires much less resources than polling in a loop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.