Delta Responses

Delta responses is a feature on top of OData 2.0 for requesting changes. The feature is defined in OData 4.0 and this is a preliminary and lightweight implementation close to the OData 4.0 specification (see here).

Because of delta responses are not defined in OData 2.0 this feature is optional.


Use Case

A client requests a (paged) feed. A server can add a delta link on the last feed page. Using the delta link returns only changed data of the feed to the client. Changed data are feed entries with changed properties or deleted entries.


A server has to implement the TombstoneCallback interface:

public interface TombstoneCallback extends ODataCallback {

Basically the implementation of this interface has to carry information about deleted data and the delta link which is realized as custom query option:


Finally the following code has to go into a ODataSingleProcessor implementation:

 * @see EntitySetProcessor
public ODataResponse readEntitySet(final GetEntitySetUriInfo uriInfo, final String contentType) throws ODataException {


  Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
  callbacks.put(TombstoneCallback.CALLBACK_KEY_TOMBSTONE, tombstoneCallback);

  EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(new URI(BASE_URI)).callbacks(callbacks).build();

  final ODataResponse response = new JsonEntityProvider().writeFeed(entitySet, roomsData, properties);


  return response;
Json Response

This is an example for a Json response:


Atom Response

This is an example of an Atom delta response (tombstones, RFC6721)

<feed ...>


<entry m:etag="W/&quot;3&quot;">
    <title type="text">Rooms</title>
    <category term="RefScenario.Room" scheme=""/>
    <link href="Rooms('2')" rel="edit" title="Room"/>
    <link href="Rooms('2')/nr_Employees" rel="" title="nr_Employees" type="application/atom+xml;type=feed"/>
    <link href="Rooms('2')/nr_Building" rel="" title="nr_Building" type="application/atom+xml;type=entry"/>
    <content type="application/xml">
        <d:Name>Neu Schwanstein2</d:Name>
<at:deleted-entry ref="http://host:80/service/Rooms('2')" when="2014-01-14T18:11:06.682+01:00"/>
<link rel="delta" href="http://host:80/service/Rooms?!deltatoken=1234"/>

Copyright © 2013-2022, The Apache Software Foundation
Apache Olingo, Olingo, Apache, the Apache feather, and the Apache Olingo project logo are trademarks of the Apache Software Foundation.