Versions Compared

Key

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

...

Note
titleJava clients

Clients other than web browsers may also interact with this application by POSTing the form data and an authentication cookie. At the moment the example application doesn't include a standalone Java client that demonstrates how to do that. This is work in progress. In the meantime, refer to this blog post the glogin component documentation for instructions how to access security-enabled GAE services using the Google ClientLogin API.

Tip
titleTutorial online

The next two sections describe how to checkout, build and deploy the example application. If you want to skip these steps, go directly to the #Usage section and use the pre-deployed example application at http://camelcloud.appspot.com.

...

  • Sign up for a Google App Engine accountif account if you don't have one.
  • Create a new application via the admin console or reuse an existing one for uploading the example.
  • Install the Google App Engine SDK for Java. This tutorial has been tested with version 1.3.06.

Deployment

First, checkout the sources from the Camel code repository.

No Format
svn co http://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-gae  camel 

Navigate to the camel-example-gae

...

and install from here.

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.

...

In the following, the application name camelcloud will be used as an example. If you deployed the example application somewhere else, use your application name instead. Go to http://camelcloud.appspot.comImage Removed. The application will redirect you to a login page (see also Security for Camel GAE Applications).

...

Background processing of the queued messages starts from("gtask://default"). The first step is to enrich the previously generated ReportData object with data from the Google weather service. The service URL is dynamically constructed by setting the Exchange.HTTP_QUERY header to weather=<city>. For example, if the user entered London in the city field of the form the resulting URL is ghttp://www.google.com/ig/api?weather=London. The weather service is accessed with the ghttp component and the weather service response is aggregated into the ReportData object using a custom aggregator returned by the reportDataAggregator() method. Generating a simple weather report from ReportData is done by the ReportGenerator. The report is then sent by email with the gmail component.