Feed aggregation is perhaps one of the simplest services you can provide on the Internet. It (usually) doesn’t require
authentication, datasets are readily available, and the data itself is simple enough that it can be stored and rendered
However it is still not trivial to build a robust and scalable feed aggregation service, as there are many concerns
one must consider. Not all feeds conform to the same standards, and even within a single standard there are different
levels of feed compliance. Scheduled feed updates and cleansing also require much consideration, along with caching
strategies, persistence, and supported rendering formats. Figurate makes these concerns much simpler by providing
pre-packaged Components and Constellations that take each of these concerns into account.
Creating a project
Starting with a new Gradle project, your build script should look like this:
OSGi Framework Selection
Figurate supports any OSGi framework that implements the OSGi FrameworkFactory. Just add the appropriate libraries
as runtime dependencies:
To provide the features required for our aggregator, we add the relevant Constellations to our build dependencies.
The constellation plugin provides additional configurations that contain pre-packaged selections of bundles. In
this instance we require the RSS, HTTP, and Felix OSGi runtime Constellations. Note how we use the bundle dependency
scope, which will ensure the OSGi bundles in each Constellation are included in the final application distribution.
Launching the application
Finally we need to specify any custom configuration for the OSGi runtime itself. Typically it will have sensible defaults,
however we still occasionally will need to override these defaults, or provide configuration where no default values are
We can test our results in a browser, or with curl as follows:
The default output is in JSON, however we can ask for YAML by adding the appropriate header:
So now we have a fully functional application that is capable of transforming and serving feeds in different formats.
Technically we can’t really call it an aggregator yet, as it doesn’t cache feed history, however that functionality
will be explored in the next instalment.