Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

app.yaml vs appengine-web.xml which one to use?

I am using Google App Engine flexible to deploy my spring boot app. I see the configuration can be specified by app.yaml or appengine-web.xml. However, my questions are,

  1. Which configuration file should I use for the Spring boot app, yaml or xml?
  2. If xml, should I create web/WEB-INF/ folder and place the appengine-web.xml under that?
  3. Also, if xml how to specify the "flex" environment choice (via which property) in the xml?

Thanks in advance.

like image 670
KayKay Avatar asked Aug 22 '17 05:08

KayKay


People also ask

What is the purpose of the app Yaml file?

The app. yaml file defines your configuration settings for your runtime as well as general app, network, and other resource settings. Do not add app.

Why is Web XML needed?

web. xml defines mappings between URL paths and the servlets that handle requests with those paths. The web server uses this configuration to identify the servlet to handle a given request and call the class method that corresponds to the request method. For example: the doGet() method for HTTP GET requests.

What is Web XML file in spring?

Spring MVC web applications use the web. xml file as a deployment descriptor file. Also, it defines mappings between URL paths and the servlets in the web.


1 Answers

You need to use both files.

The app.yaml file covers configurations applicable to all flexible environment apps/services, regardless of the language they're written in, like:

  • the flex environment and other General settings
  • Network settings
  • Health checks
  • Service scaling settings

The web.xml config file has a very specific coverage, which doesn't overlap the app.yaml file's coverage:

The web.xml file is only used when deploying a Java app to a runtime that includes the Jetty9/servlet3 server. For more details, see the Java 8 / Jetty 9.3 Runtime.

As for your #2 question, you may have been looking at the standard env docs (check the docs/standard or docs/flexible strings in the doc's URL). From web.xml:

This file is named web.xml, and resides in the app's WAR under the WEB-INF/ directory. web.xml is part of the servlet standard for web applications.

like image 50
Dan Cornilescu Avatar answered Sep 18 '22 17:09

Dan Cornilescu