nakadi-client: Client library for the Nakadi Event Broker

[ bsd3, library, network ] [ Propose Tags ]

This package implements a client library for interacting with the Nakadi event broker system developed by Zalando.


[Skip to Readme]
Versions 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.4.0.0, 0.4.1.0, 0.5.0.0, 0.5.0.1, 0.5.0.3, 0.5.1.0, 0.6.0.0
Dependencies aeson, aeson-casing, base (>=4.7 && <5), bytestring, conduit, conduit-combinators, conduit-extra, containers, exceptions, hashable, http-client, http-client-tls, http-conduit, http-types, iso8601-time, lens, monad-control, monad-logger, mtl, resourcet, retry, safe-exceptions, scientific, split, template-haskell, text, time, transformers, transformers-base, unliftio-core, unordered-containers, uuid, vector [details]
License BSD-3-Clause
Copyright (c) 2017, 2018 Moritz Clasmeier
Author Moritz Clasmeier
Maintainer mtesseract@silverratio.net
Category Network
Home page https://github.com/mtesseract/nakadi-haskell#readme
Bug tracker https://github.com/mtesseract/nakadi-haskell/issues
Source repo head: git clone https://github.com/mtesseract/nakadi-haskell
Uploaded by mtesseract at Sun Feb 18 21:30:46 UTC 2018
Distributions NixOS:0.6.0.0
Downloads 995 total (25 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2018-02-18 [all 2 reports]
Hackage Matrix CI

Modules

  • Network
    • Network.Nakadi
      • Network.Nakadi.Base
      • Network.Nakadi.Config
      • Network.Nakadi.EventTypes
        • Network.Nakadi.EventTypes.CursorDistances
        • Network.Nakadi.EventTypes.CursorsLag
        • Network.Nakadi.EventTypes.EventType
        • Network.Nakadi.EventTypes.Events
        • Network.Nakadi.EventTypes.Partitions
        • Network.Nakadi.EventTypes.Schemas
        • Network.Nakadi.EventTypes.ShiftedCursors
      • Network.Nakadi.HttpBackendIO
      • Internal
        • Network.Nakadi.Internal.Http
        • Network.Nakadi.Internal.Retry
      • Network.Nakadi.Lenses
      • Network.Nakadi.Prelude
      • Network.Nakadi.Registry
      • Network.Nakadi.Subscriptions
        • Network.Nakadi.Subscriptions.Cursors
        • Network.Nakadi.Subscriptions.Events
        • Network.Nakadi.Subscriptions.Stats
        • Network.Nakadi.Subscriptions.Subscription
      • Network.Nakadi.Types
        • Network.Nakadi.Types.Config
        • Network.Nakadi.Types.Exceptions
        • Network.Nakadi.Types.Logger
        • Network.Nakadi.Types.Problem
        • Network.Nakadi.Types.Service

Flags

NameDescriptionDefaultType
develDisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for nakadi-client-0.5.0.0

[back to package description]

nakadi-client Hackage version Stackage version Build Status

About

nakadi-client is a BSD2/BSD3 licensed Haskell client library for interacting with the Nakadi event broker system developed by Zalando. The streaming is built on top of Conduit.

Please note that the API is not considered stable yet.

nakadi-client provides:

  • Docker based test suite testing against the official Nakadi docker image (in progress).

  • A rather direct translation of Nakadi's REST API to Haskell. Thus, if you are familiar with Nakadi's REST API, the API exposed by nakadi-client will feel very familiar.

  • Where suitable, nakadi-client provides additional higher-level interfaces.

  • A type-safe API for interacting with Nakadi. For example, the name of an event type has type EventTypeName, not Text or something generic.

  • Integrated and configurable retry mechanism.

  • Conduit based interfaces for streaming events.

  • Convenient Subscription API interface (subscriptionSource & runSubscription), which frees the user from any manual bookkeeping of the Subscription Stream ID necessary for commiting cursors.

  • Mechanism for registering callbacks for logging and token injection.

  • Correct types for values like CursorOffset (which must be treated as opaque strings).

  • Basically each API function is exposed in two versions: One which requires the caller to pass in a Nakadi configuration value containing the information about how to connect to Nakadi and one which is suffixed with R (think: Reader monad), which expects to find the Nakadi configuration in the environment provided by a reader monad in your application's monad stack.

Example

Example code showing how to dump a subscription:

dumpSubscription :: (MonadLogger m, MonadNakadi IO m) => Nakadi.SubscriptionId -> m ()
dumpSubscription subscriptionId =
  Nakadi.subscriptionProcess Nothing subscriptionId processBatch

  where processBatch :: MonadLogger m => Nakadi.SubscriptionEventStreamBatch Value -> m ()
        processBatch batch =
          logInfoN (tshow batch)