Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GAE modules on development server

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.

like image 418
markovuksanovic Avatar asked Nov 21 '13 05:11

markovuksanovic


1 Answers

It is possible to set the port of each module using JVM parameters.

-Dcom.google.appengine.devappserver_module.{module_name}.port=8081

I use the appengine-maven-plugin with the following configuration (my bespoke module is called "analysis"):

<plugin>
   <groupId>com.google.appengine</groupId>
   <artifactId>appengine-maven-plugin</artifactId>
   <configuration>
      <jvmFlags>
         <jvmFlag>-Ddatastore.backing_store=${project.basedir}/target/local_db.bin</jvmFlag>
         <jvmFlag>-Xdebug</jvmFlag>
         <jvmFlag>-Dcom.google.appengine.devappserver_module.analysis.port=8081</jvmFlag>
         <jvmFlag>-XX:MaxPermSize=512m</jvmFlag>
         <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8001,server=y,suspend=n</jvmFlag>
      </jvmFlags>
      <enhancerApi>JPA</enhancerApi>
      <fullScanSeconds>2</fullScanSeconds>
   </configuration>
</plugin>

When I run the mvn appengine:devserver then the logs corresponding to that module are like this:

[INFO] INFO: Started [email protected]:8081
[INFO] Jun 10, 2014 10:44:16 AM com.google.appengine.tools.development.JettyContainerService startHotDeployScanner
[INFO] INFO: Full scan of the web app in place every 2s.
[INFO] Jun 10, 2014 10:44:16 AM com.google.appengine.tools.development.AbstractModule startup
[INFO] INFO: Module instance analysis is running at http://localhost:8081/
[INFO] Jun 10, 2014 10:44:16 AM com.google.appengine.tools.development.AbstractModule startup
[INFO] INFO: The admin console is running at http://localhost:8081/_ah/admin
[INFO] Jun 10, 2014 11:44:16 AM com.google.appengine.tools.development.DevAppServerImpl doStart
[INFO] INFO: Dev App Server is now running

I hope it helped.

like image 118
nomukaiki Avatar answered Sep 24 '22 02:09

nomukaiki