Available as of Camel 2.1
gtask component contributes to the Camel Components for Google App Engine (GAE). It supports asynchronous message processing on GAE by using the task queueing service as message queue. For adding messages to a queue it uses the task queue API. For receiving messages from a queue it installs an HTTP callback handler. The handler is called by an HTTP POST callback (a web hook) initiated by the task queueing service. Whenever a new task is added to a queue a callback will be sent. The
gtask component abstracts from these details and supports endpoint URIs that make message queueing on GAE as easy as message queueing with JMS or SEDA.
The servlet mapping for callback handlers. By default, this component requires a callback servlet mapping of
/worker/*. If another servlet mapping is used e.g.
/myworker/* it must be set as option on the producer side:
Reference to an
InboundBinding<GTaskEndpoint, HttpServletRequest, HttpServletResponse> in the Registry for customizing the binding of an
Exchange to the Servlet API. The referenced binding is used as post-processor to
Reference to an
OutboundBinding<GTaskEndpoint, TaskOptions, void> in the Registry for customizing the binding of an
Exchange to the task queueing service.
On the consumer-side, all options of the Servlet component are supported.
On the consumer-side all headers of the Servlet component component are supported plus the following.
Name of the task queue.
Name of the task (generated value).
Number of callback retries.
On the producer side the
in message body is converted to a
byte and is POSTed to the callback handler as content-type
Setting up tasks queues is an administrative task on Google App Engine. Only one queue is pre-configured and can be referenced by name out-of-the-box: the
default queue. This queue will be used in the following examples. Please note that when using task queues on the local development server, tasks must be executed manually from the developer console.
.to(gtask:default) // add message to default queue
from(gtask:default) // receive message from default queue (via a web hook)
This example requires the following servlet mapping.
Maven users will need to add the following dependency to their