• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Clojure
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chronicle Queue helpers

tape

cljdoc badge Clojars Project

Simple Chronicle Queue 5 helpers for clojure.

Micro second messaging that stores everything to disk

In short for when Kafka is too much and durable-queue not enough.

Chronicle Queue is similar to a low latency broker-less durable/persisted JVM topic. Tape focuses on embedded usage (we do not support topic distribution). It's essentially a disk-backed queue, allowing for queues that can survive processes dying, and whose size is bounded by available disk rather than memory.

Conceptually the api is somewhat similar to kafka, you can replay queues, set tailer's index etc... It stores everything on flat-files, you can control how rollup/purge of these happens via queue options.

I'd encourage you read about Chronicle Queue if you want to use this lib, Chronicle Queue comes with its set of tradeoffs you want to know first.

Started with a fork of https://github.com/malesch/croque and ended up rewriting/dropping most of it, hence the rename.

Installation

tape is available on Clojars.

Usage

(ns foo
  (:require [qbits.tape.tailer :as tailer]
            [qbits.tape.appender :as appender]
            [qbits.tape.queue :as queue]))

;; create a queue instance
(def q (queue/make "/tmp/q1"))

;; create a tailer bound to that queue
(def t (tailer/make q))

;; nothing in queue yet, so nil
(tailer/read! t) => nil

;; to add to queue you need an appender
(def appender (appender/make q))

;; add stuff to queue, returns index
(appender/write! appender {:foo [:bar {:baz 0}]}) => 76759655514210
(appender/write! appender {:another :thing}) => 76759655514211

(tailer/read! t) => {:foo [:bar {:baz 0}]}
(tailer/read! t) => {:another :thing}
(tailer/read! t) => nil ;; empty now


;; back to some existing index, essentially rewinding to it
(tailer/to-index! t 76759655514210)

;; Tailers are also Sequential/Seqable/Reducible and behave as such.

(run! (fn [msg] (println msg)) t)

(doseq [msg t]
  (println msg))

[...]

There's also a core.async facade for appenders/tailers on qbits.tape.async and other utilities to cleanup queues files you don't care about anymore. Anything created with a make function can be inspected with clojure.datafy/datafy.

We serialize data with fressian as a default, but you can supply your own qbits.tape/ICodec when you make/bind to a queue if you need to use something else.

License

Copyright ยฉ 2019 Max Penet

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

More Repositories

1

spandex

Elasticsearch client for Clojure (built on new ES 8.x java client)
Clojure
261
star
2

alia

High performance Cassandra client for clojure
Clojure
246
star
3

jet

[not maintained, use at own risk] Jetty9 ring server adapter with WebSocket support via core.async and Jetty9 based HTTP & WebSocket clients (jvm based, no cljs)
Clojure
167
star
4

hirundo

Helidon 4.x RING adapter - using loom/java21+
Clojure
100
star
5

hayt

CQL3 DSL for Clojure
Clojure
74
star
6

clojure-snippets

yasnippet 0.7.0+ snippets for clojure
Emacs Lisp
58
star
7

auspex

Mini wrapper over java CompletableFuture with a manifold deferred after-taste
Clojure
42
star
8

knit

Thin wrapper around Java Executors/Threads, including configurable `future`, `c.core/thread`, and `future-call`
HTML
33
star
9

pact

clojure.spec to json-schema generation library
Clojure
25
star
10

thorn

Homoglyph/IDN homograph detection/handling - Clojure port of python confusable_homoglyphs
Clojure
22
star
11

flex

Using TCP congestion control methods to find/set real limits of a system over time
Clojure
20
star
12

sextant

Offline location geocoder/reverse geocoder from GeoName datasets
Java
18
star
13

ex

Exception net
Clojure
17
star
14

casyn

Clojure client for Cassandra using Thrift AsyncClient - For a better/more robust client using CQL3 see https://github.com/mpenet/alia
Clojure
17
star
15

spex

Utils/Helpers for clojure spec
Clojure
16
star
16

checkmate

All your fails are belong to us
Clojure
14
star
17

jilch

Clojure ZeroMQ Library using Jeromq (drop in replacement for zilch)
Clojure
12
star
18

emax

my .emacs.d
Emacs Lisp
12
star
19

esearch

Elastic Search client for Clojure
Clojure
11
star
20

eddy

Jetty11+ wrapper/adapter for clojure
Clojure
7
star
21

caffeine

Simple wrapper for com.github.ben-manes.caffeine/caffeine
Clojure
7
star
22

nippy-lz4

LZ4 compression for ptaoussanis/nippy
Clojure
6
star
23

commons

stuff
Clojure
5
star
24

bootstrap-mod

Modular twitter/bootstrap
5
star
25

thera

Deprecated: give a try to mpenet/casyn (thrift) or mpenet/alia (CQL3) instead- Clojure Cassandra CQL client
Clojure
5
star
26

tardis

Minimalistic library to manage Type 1 UUIDs (time based) - com.eaio.uuid wrapper
Clojure
4
star
27

grease

Some utils for performance critical situations
Java
4
star
28

ash

Simple, extensible irc bot based on pircbotx
Clojure
4
star
29

xmonad

(minimalistic) xmonad/trayer/xmobar config with a zenburn'ish theme. Supports both t410s and xps13 sputnik
Shell
4
star
30

sextant_

Geo location utility functions
Clojure
3
star
31

unilog-sentry

Sentry appender for pyr/unilog
Clojure
3
star
32

ring-spec

clojure.specs for the latest RING
Clojure
2
star
33

tempel-clojure

tempel snippets for clojure
Emacs Lisp
2
star
34

quiver

Clojure 1.5 new threading macros as a library
Clojure
2
star
35

softshake-talk

2
star
36

mehub

GitHub personal page (static, js/ClojureScript based)
JavaScript
2
star
37

pod

Walks like an atom, and quacks like an atom but...
Clojure
2
star
38

dam

Redis/LUA backed rate limiting for clojure
Clojure
2
star
39

sibilant-mode

sibilant emacs mode
Emacs Lisp
2
star
40

padded-modeline

Padded emacs modeline
Emacs Lisp
1
star
41

bug-playground

where bugs multiply and thrive
Clojure
1
star
42

record-utils

Clojure
1
star