开发服务器上的 GAE 模块 [英] GAE modules on development server

查看:28
本文介绍了开发服务器上的 GAE 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Google AppEngine 中使用多个模块,想知道是否可以运行开发服务器(java 版本)以便分配给不同模块的端口始终相同?目前他们似乎是随机的.我可以决定那些端口吗?我希望能够以可持续的方式(从开发角度)建立模块之间的通信.目前,如果我们有两个模块,我们称它们为 A 和 B,并且我们想在模块 B 中使用模块 A 公开的服务,则没有简单的方法可以知道要从模块 B 访问哪个 URL.

I'm using multiple modules with Google AppEngine and was wondering if its possible to run development server (java version) so that ports that are assigned to different modules are always the same? At the moment they seem to be random. Can I decide on those ports? I would like to be able to establish communication with between modules in a sustainable way (from the development perspective). At the moment if we have two modules, let's call them A and B, and we would like to consume services exposed by module A in module B there's no easy way to know which URL to hit from module B.

推荐答案

尽管 modules service 在这种情况下可能很有用,我相信它会起作用,我以稍微不同的方式解决了这个问题.

Although the modules service could be useful in this scenario, and I believe it would work, I solve the problem in a bit different way.

我修改了我的构建脚本以在本地主机上运行所有模块,但在不同的端口上运行(本质上有一些本地 appengine 实例正在运行).配置信息 (IP:PORT) 存储在配置文件中,任何模块都可以轻松访问.对于部署,我仍然将应用程序打包到 ear 存档中.

I modified my build script to run all the modules on localhost, but on different port (essentially there are a few local appengine instances running). The configuration information (IP:PORT) is stored in a configuration file and is easily accessible to any module. For the deployment I still package the application into an ear archive.

这篇关于开发服务器上的 GAE 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆