About the NewsGroupGetNode sample

This sample demonstrates how a JavaCompute node can call out to an external API and augment an incoming message with the results of this call.

The node extracts the newsgroup and searchexpression element values from the incoming message. The JavaMail API is then used to search the newsgroup for postings that have a subject that match the searchexpression.

Note that the sample uses the NNTP Provider for Javamail and requires the nntp.jar file that can be obtained by following the steps on the Setup instructions page.

This sample covers the following steps:

  1. Extracts the newsgroup and searchexpression element values from an incoming message, using XPAth expressions.
  2. Calls out to an external API (JavaMail) to search the newsgroup for messages that match the searchexpression. This returns an array of matching messages.
  3. Builds the output message based on the search results.
  4. Propagates the augmented output message to the out terminal of the JavaCompute node.

The following MQ queues are created by the sample:

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

NewsGroupGetNodeFlow

Main Page iconBack to About the JavaCompute Node sample