Camel Components for Google App Engine
This component is deprecated and will be removed form Camel 2.18 onwards.
The Camel components for Google App Engine (GAE) are part of the
camel-gae project and provide connectivity to GAE's cloud computing services. They make the GAE cloud computing environment accessible to applications via Camel interfaces. Following this pattern for other cloud computing environments could make it easier to port Camel applications from one cloud computing provider to another. The following table lists the cloud computing services provided by Google and the supporting Camel components. The documentation of each component can be found by following the link in the Camel Component column.
Setting up a
SpringCamelContext on Google App Engine differs between Camel 2.1 and higher versions. The problem is that usage of the Camel-specific Spring configuration XML schema from the
http://camel.apache.org/schema/spring namespace requires JAXB and Camel 2.1 depends on a Google App Engine SDK version that doesn't support JAXB yet. This limitation has been removed since Camel 2.2.
JMX must be disabled in any case because the
javax.management package isn't on the App Engine JRE whitelist.
camel-gae 2.1 comes with the following
Both disable JMX before startup. The
GaeSpringCamelContext additionally provides setter methods adding route builders as shown in the next example.
Alternatively, use the
routeBuilders property of the
GaeSpringCamelContext for setting a list of route builders. Using this approach, a
SpringCamelContext can be configured on GAE without the need for JAXB.
Camel 2.2 or higher
With Camel 2.2 or higher, applications can use the
http://camel.apache.org/schema/spring namespace for configuring a
SpringCamelContext but still need to disable JMX. Here's an example.
Running Camel on GAE requires usage of the
camel-servlet. The following example shows how to configure this servlet together with a Spring application context XML file.
The location of the Spring application context XML file is given by the
contextConfigLocation init parameter. The
appctx.xml file must be on the classpath. The servlet mapping makes the Camel application accessible under
http://<appname>.appspot.com/camel/... when deployed to Google App Engine where
<appname> must be replaced by a real GAE application name. The second servlet mapping is used internally by the task queueing service for background processing via web hooks. This mapping is relevant for the gtask component and is explained there in more detail.