The web interface provided with the Stroom reference implementation is by far the quickest way to prototype simple flows of stream-based data, but if you are looking to do some serious number crunching or need to use extensive libraries for data processing tasks such as NLP you will probably want to write a standalone service that can read and process data from one or more streams in your Stroom installation. For this purpose, you can either manually access Stroom through the Http-based API or use the client library introduced in the v0.1.3 release.
This first version of the client library is written in Java 8, specifically server side JVM usage. Let’s have a look at a very simple code sample that instantiates the Stroom client library, gets the count of documents in a stream, and appends a document.
Aggregates are equally simple to implement using the Java 8 lambda syntax. The following sample reads the previous word output and maintains an aggregate with a simple count.
We look forward to adding more features to this Java-based client library as well as introducing new client libraries for many other languages currently in use at DoubleDutch. Got a specific language you would love to be writing your Stroom services in? Let us know in our google group: https://groups.google.com/forum/#!forum/stroomdata
As always, follow us on Twitter @StroomData to stay up-to-date on releases, screencasts, and other Stroom related news! Have a look at the github repo https://github.com/DoubleDutch/StroomData for more information and to download the latest release!