Skip to content

Commit 554a57f

Browse files
author
Jonathan Simon
committed
Adding pull task queue sample
1 parent 42b774a commit 554a57f

14 files changed

+846
-0
lines changed

appengine/taskqueue/pull/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Pull task Queue sample for Google App Engine
2+
3+
This sample demonstrates how to use [pull task queues][appid] on [Google App
4+
Engine][ae-docs].
5+
6+
[appid]: https://cloud.google.com/appengine/docs/java/taskqueue/overview-pull
7+
[ae-docs]: https://cloud.google.com/appengine/docs/java/
8+
9+
## Running locally
10+
This example uses the
11+
[Maven gcloud plugin](https://cloud.google.com/appengine/docs/java/managed-vms/maven).
12+
To run this sample locally:
13+
14+
$ mvn appengine:devserver
15+
16+
## Deploying
17+
In the following command, replace YOUR-PROJECT-ID with your
18+
[Google Cloud Project ID](https://developers.google.com/console/help/new/#projectnumber).
19+
20+
$ mvn appengine:update -Dappengine.appId=YOUR-PROJECT-ID -Dappengine.version=SOME-VERSION
21+
22+
## Setup
23+
To save your project settings so that you don't need to enter the
24+
parameters, you can:
25+
26+
1. Update the <application> tag in src/main/webapp/WEB-INF/appengine-web.xml
27+
with your project name.
28+
29+
2. Update the <version> tag in src/main/webapp/WEB-INF/appengine-web.xml
30+
with a valid version number.
31+
32+
33+
You will now be able to run
34+
35+
$ mvn appengine:update
36+
37+
without the need for any additional parameters.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3+
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4+
<stringAttribute key="M2_GOALS" value="appengine:devserver"/>
5+
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6+
<booleanAttribute key="M2_OFFLINE" value="false"/>
7+
<stringAttribute key="M2_PROFILES" value=""/>
8+
<listAttribute key="M2_PROPERTIES"/>
9+
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
10+
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
11+
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
12+
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}"/>
14+
</launchConfiguration>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3+
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4+
<stringAttribute key="M2_GOALS" value="appengine:update"/>
5+
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6+
<booleanAttribute key="M2_OFFLINE" value="false"/>
7+
<stringAttribute key="M2_PROFILES" value=""/>
8+
<listAttribute key="M2_PROPERTIES"/>
9+
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
10+
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
11+
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
12+
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}"/>
14+
</launchConfiguration>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#set( $symbol_pound = '#' )
2+
#set( $symbol_dollar = '$' )
3+
#set( $symbol_escape = '\' )
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<actions>
6+
<action>
7+
<actionName>CUSTOM-appengine:devserver</actionName>
8+
<displayName>appengine:devserver</displayName>
9+
<goals>
10+
<goal>appengine:devserver</goal>
11+
</goals>
12+
</action>
13+
<action>
14+
<actionName>CUSTOM-appengine:update</actionName>
15+
<displayName>appengine:update</displayName>
16+
<goals>
17+
<goal>appengine:update</goal>
18+
</goals>
19+
</action>
20+
<action>
21+
<actionName>CUSTOM-appengine:rollback</actionName>
22+
<displayName>appengine:rollback</displayName>
23+
<goals>
24+
<goal>appengine:rollback</goal>
25+
</goals>
26+
</action>
27+
<action>
28+
<actionName>CUSTOM-appengine:update_cron</actionName>
29+
<displayName>appengine:update_cron</displayName>
30+
<goals>
31+
<goal>appengine:update_cron</goal>
32+
</goals>
33+
</action>
34+
<action>
35+
<actionName>CUSTOM-appengine:update_dos</actionName>
36+
<displayName>appengine:update_dos</displayName>
37+
<goals>
38+
<goal>appengine:update_dos</goal>
39+
</goals>
40+
</action>
41+
<action>
42+
<actionName>CUSTOM-appengine:update_indexes</actionName>
43+
<displayName>appengine:update_indexes</displayName>
44+
<goals>
45+
<goal>appengine:update_indexes</goal>
46+
</goals>
47+
</action>
48+
<action>
49+
<actionName>CUSTOM-appengine:update_queues</actionName>
50+
<displayName>appengine:update_queues</displayName>
51+
<goals>
52+
<goal>appengine:update_queues</goal>
53+
</goals>
54+
</action>
55+
</actions>

appengine/taskqueue/pull/pom.xml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2015 Google Inc. All Rights Reserved.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<packaging>war</packaging>
21+
<version>1.0-SNAPSHOT</version>
22+
<groupId>com.example.taskqueue</groupId>
23+
<artifactId>taskqueue</artifactId>
24+
25+
<properties>
26+
<app.version>1</app.version>
27+
<appengine.version>1.9.34</appengine.version>
28+
<gcloud.plugin.version>2.0.9.74.v20150814</gcloud.plugin.version>
29+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30+
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
31+
</properties>
32+
33+
<prerequisites>
34+
<maven>3.1.0</maven>
35+
</prerequisites>
36+
<dependencies>
37+
<!-- Compile/runtime dependencies -->
38+
<dependency>
39+
<groupId>com.google.appengine</groupId>
40+
<artifactId>appengine-api-1.0-sdk</artifactId>
41+
<version>${appengine.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>javax.servlet</groupId>
45+
<artifactId>servlet-api</artifactId>
46+
<version>2.5</version>
47+
<scope>provided</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>jstl</groupId>
51+
<artifactId>jstl</artifactId>
52+
<version>1.2</version>
53+
</dependency>
54+
55+
<!-- Test Dependencies -->
56+
<dependency>
57+
<groupId>com.google.appengine</groupId>
58+
<artifactId>appengine-testing</artifactId>
59+
<version>${appengine.version}</version>
60+
<scope>test</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>com.google.appengine</groupId>
64+
<artifactId>appengine-api-stubs</artifactId>
65+
<version>${appengine.version}</version>
66+
<scope>test</scope>
67+
</dependency>
68+
</dependencies>
69+
70+
<build>
71+
<!-- for hot reload of the web application-->
72+
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
73+
<plugins>
74+
<plugin>
75+
<groupId>org.codehaus.mojo</groupId>
76+
<artifactId>versions-maven-plugin</artifactId>
77+
<version>2.1</version>
78+
<executions>
79+
<execution>
80+
<phase>compile</phase>
81+
<goals>
82+
<goal>display-dependency-updates</goal>
83+
<goal>display-plugin-updates</goal>
84+
</goals>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
<plugin>
89+
<groupId>org.apache.maven.plugins</groupId>
90+
<version>3.1</version>
91+
<artifactId>maven-compiler-plugin</artifactId>
92+
<configuration>
93+
<source>1.7</source>
94+
<target>1.7</target>
95+
</configuration>
96+
</plugin>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-war-plugin</artifactId>
100+
<version>2.4</version>
101+
<configuration>
102+
<archiveClasses>true</archiveClasses>
103+
<webResources>
104+
<!-- in order to interpolate version from pom into appengine-web.xml -->
105+
<resource>
106+
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
107+
<filtering>true</filtering>
108+
<targetPath>WEB-INF</targetPath>
109+
</resource>
110+
</webResources>
111+
</configuration>
112+
</plugin>
113+
114+
<plugin>
115+
<groupId>com.google.appengine</groupId>
116+
<artifactId>appengine-maven-plugin</artifactId>
117+
<version>${appengine.version}</version>
118+
<configuration>
119+
<enableJarClasses>false</enableJarClasses>
120+
<version>${app.version}</version>
121+
<!-- Comment in the below snippet to bind to all IPs instead of just localhost -->
122+
<!-- address>0.0.0.0</address>
123+
<port>8080</port -->
124+
<!-- Comment in the below snippet to enable local debugging with a remote debugger
125+
like those included with Eclipse or IntelliJ -->
126+
<!-- jvmFlags>
127+
<jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
128+
</jvmFlags -->
129+
</configuration>
130+
</plugin>
131+
<plugin>
132+
<groupId>com.google.appengine</groupId>
133+
<artifactId>gcloud-maven-plugin</artifactId>
134+
<version>${gcloud.plugin.version}</version>
135+
<configuration>
136+
<set_default>true</set_default>
137+
</configuration>
138+
</plugin>
139+
</plugins>
140+
</build>
141+
</project>
142+

0 commit comments

Comments
 (0)