简体   繁体   English

将Jetty8网络应用程序迁移到Google App Engine

[英]Migrate a jetty8 web app to google app engine

I have a web application currently deployed in jetty8, which is based on jsf2, jersey and atmosphere. 我有一个当前在jetty8中部署的Web应用程序,该应用程序基于jsf2,球衣和大气。 I would like to migrate to GAE but the following question comes up to me: 我想迁移到GAE,但出现以下问题:

Does GAE support jetty8? GAE是否支持jetty8?

There is a servlet that performs periodically a data base cleaning task every day. 有一个Servlet每天定期执行数据库清理任务。 In order to do that a task gets spawn at the beginning and delayed in a loop in order to run every 24h. 为了做到这一点,一个任务在开始时产生,并在循环中延迟以每24小时运行一次。 I've read GAE does not allow tasks to be spawned. 我读过GAE不允许产生任务。 Is there another way to do that and be supported by GAE? 还有其他方法可以得到GAE的支持吗?

I don't know if GAE supports version 8 of Jetty specifically, but it runs on Jetty instances. 我不知道GAE是否特别支持Jetty的版本8,但它可以在Jetty实例上运行。

You have to think of GAE more as a PAAS (platform as a service) than an IAAS (infrastructure as a service) provider. 您必须将GAE看作是PAAS(平台即服务)提供商,而不是IAAS(基础设施即服务)提供商。 You have to take a look at the services they provide and check if they match your requirements. 您必须查看它们提供的服务,并检查它们是否符合您的要求。 See What Is Google App Engine? 请参阅什么是Google App Engine? for a general overview or Java Enterprise Edition (Java EE) Technologies for specific framework compatibility. 以获得一般概述,或通过Java Enterprise Edition(Java EE)技术获得特定的框架兼容性。 The GAE is not a common JRE, it has a limited set of supported classes: The JRE Class White List . GAE不是常见的JRE,它具有一组受支持的类: JRE类白名单 This may limit compatibility further. 这可能会进一步限制兼容性。 I don't know if Atmosphere runs. 我不知道气氛是否运行。 I don't know what Jetty 8 specifics you need. 我不知道您需要什么Jetty 8细节。 Websockets? Websockets? No. You may use channels instead: The Channel API (Java) . 不能。您可以改用渠道: Channel API(Java)

Long running tasks are not allowed the way you do it (a 24h delay). 不允许长时间运行的任务(延迟24小时)。 But you can start scheduled tasks, see here: Scheduled Tasks With Cron for Java . 但是您可以启动计划任务,请参见此处: 使用Cron for Java计划任务

Request are limited in execution time (60 seconds) so you can't run long running tasks that way. 请求的执行时间有限(60秒),因此您不能以这种方式运行长时间运行的任务。 But you can spawn longer running (10 minutes) background tasks, see here: The Task Queue Java API . 但是您可以生成运行时间更长(10分钟)的后台任务,请参见此处: Task Queue Java API

Important: Look at the quotas . 重要提示:查看配额 As they punish certain application behaviour you will need to adapt your application to this. 当它们惩罚某些应用程序行为时,您将需要使您的应用程序适应此行为。 This can totally change your application design! 这可以完全改变您的应用程序设计!

In my experience migrating to GAE is an intense engagement. 以我的经验,迁移到GAE是一种高度投入。 GAE is not suited as a drop in replacement for other hosting solutions. GAE不适合替代其他托管解决方案。 If you want such IAAS providers (like Amazon EC2) are better suited. 如果您希望这样的IAAS提供程序(例如Amazon EC2)更适合。

All good information, with just one correction - user requests are now limited to 60 seconds rather than 30 seconds. 所有良好的信息,只需进行一次更正-用户请求现在限制为60秒而不是30秒。

It should also be noted that there are the following restrictions: 还应注意,存在以下限制:

  • The HTTP Session lifecycle is not truly honoured as per the Java EE spec. 根据Java EE规范,HTTP会话生命周期并没有真正兑现。 For example, if you change the values of an object in the session you must re-set it for the data to be propagated throughout all instances. 例如,如果您在会话中更改对象的值,则必须重新设置该对象,以便在所有实例中传播数据。
  • You can't spawn your own threads - this can cause some issues for some of the JSF implementations, so it may be worth checking with your JSF provider to see whether they support GAE. 您无法生成自己的线程-这可能会给某些JSF实现带来一些问题,因此可能值得与您的JSF提供者进行检查,以查看它们是否支持GAE。 I know off the top of my head that the latest version of JBoss RichFaces supports GAE. 我知道,最新版本的JBoss RichFaces支持GAE。
  • Atmosphere native support for GAE channels was originally scheduled for v0.8, but appears to have slipped out of that release. 最初计划在v0.8中提供对GAE频道的Atmosphere原生支持,但似乎已从该版本中退出。

How are you planning on migrating your data model to the GAE datastore? 您如何计划将数据模型迁移到GAE数据存储区? The GAE datastore really doesn't suit a JPA/JDO-based model, as it is significantly different than normal relation databases. GAE数据存储确实不适合基于JPA / JDO的模型,因为它与正态关系数据库有显着差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM