dehora / nakadi-java

🌀 Client library for the Nakadi Event Broker (examples: http://bit.ly/njc-examples, site: https://dehora.github.io/nakadi-java/)
MIT License
30 stars 19 forks source link

Allows a consumer to see the checkpoint response result from the server. #312

Closed dehora closed 7 years ago

dehora commented 7 years ago

This provides a consumer hook to view the CursorCommitResultCollection result from the server, along with the initiating StreamCursorContext. If the CursorCommitResultCollection.items() collection is empty (a 200 Ok) from the server it means the server moved the cursor forward. If the CursorCommitResultCollection.items() collection is not empty (a 204 No-Content) it means the server ignored a stale cursor. A stale cursor is strongly indicative of a local processing problem.

This change also adds metrics for the two result forms to the MetricCollector object and calls the collector based on the server result.