Skip to content

Reading feeds using AtomFeed Client

theghostwhoforks edited this page Apr 12, 2013 · 3 revisions

AtomFeed Client is an atom client written to enable easy consumption of events given a feed URL. This module has been written primarily to act as a reference implementation for building feed clients. The client is used by the motech atom client module to process events.

It is not mandatory to use the client along with the atomfeed-server.

Design

The design on the client is fairly simple. The AtomFeedClient is essentially a wrapper over a WebClient that communicates with any ATOM server and returns a list of events. In addition, it has the ability to not query the server for any event that has already been read. See the Using Atom Feed Client to read Events section below to see how a consumer can use the client.

Usage with maven

Use the following lines in your pom file (with the appropriate version number)

    <dependency>
        <groupId>org.ict4h</groupId>
        <artifactId>atomfeed-client</artifactId>
        <version>VERSION_NUMBER</version>
    </dependency>

Please check maven central to get the latest version of the published artefact.

Using Atom Feed Client to read Feeds

Look at this integration test to see how the client can be used to consume feeds and use the marker to ensure that only unprocessed events are fetched from the server.