About the GoogleAPINode sample

This sample demonstrates how a JavaCompute node can call out to an external service and propagate a new message based on the results of this call.

The node extracts the key and querystring element values from the incoming message. It uses this information to perform a Google search. The result of this search is used to create the outgoing message.

Note that the sample uses the Google Web APIs and requires the googleapi.jar file and a license key that can be obtained by following the steps on the Setup instructions page.

This sample covers the following:

  1. Extracts the querystring and key element values from an incoming message, using XPath expressions.
  2. Calls out to an external API (Google) to perform a search. This returns an array of matching messages.
  3. Builds the output message based on the search result(s).
  4. Propagates the output message to the out terminal of the JavaCompute node.

The following MQ queues are created by the sample:

The following message flow, GoogleAPINodeFlow, is imported by the sample:

GoogleAPINodeFlow

Main Page iconBack to About the JavaCompute Node sample