Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3


Open the camel-example-gae/src/main/webapp/WEB-INF/application-web.xml file and replace the template application name replaceme with the name of the application that you created in the previous section. Optionally, adjust the version number if needed.

Code Block
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="">
        Set your application name and version here
        <exclude path="/index.html" />

        <property name="java.util.logging.config.file" value="WEB-INF/"/>


The TutorialRouteBuilder implements the message processing routes shown in the #Overview section. Input form data are received via the ghttp component. After receiving the request a RequestProcessor adds the form data and information about the current user to a ReportData POJO. The ReportData object is then serialized and queued for background processing. Queueing messages on GAE is done with the gtask component. After adding the ReportData object to the queue an HTML response is generated with the ResponseProcessor.

Code Block
package org.apache.camel.example.gae;

import org.w3c.dom.Document;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.gae.mail.GMailBinding;
import org.apache.camel.processor.aggregate.AggregationStrategy;

public class TutorialRouteBuilder extends RouteBuilder {

    public void configure() throws Exception {
            .process(new RequestProcessor())
            .process(new ResponseProcessor());
            .setHeader(Exchange.HTTP_QUERY, constant("weather=").append(
            .enrich("g", reportDataAggregator())
            .setHeader(GMailBinding.GMAIL_SUBJECT, constant("Weather report"))
            .setHeader(GMailBinding.GMAIL_SENDER, ReportData.requestor())
            .setHeader(GMailBinding.GMAIL_TO, ReportData.recipient())
            .process(new ReportGenerator())        

    private static AggregationStrategy reportDataAggregator() {
        return new AggregationStrategy() {
            public Exchange aggregate(Exchange reportExchange, Exchange weatherExchange) {
                ReportData reportData = reportExchange.getIn().getBody(ReportData.class);
                return reportExchange;