{"id":19189334,"url":"https://github.com/asmuth/brokerd","last_synced_at":"2025-05-08T03:08:53.955Z","repository":{"id":3271513,"uuid":"4310916","full_name":"asmuth/brokerd","owner":"asmuth","description":"Message broker with log-structured storage and HTTP API","archived":false,"fork":false,"pushed_at":"2023-09-08T00:51:04.000Z","size":655,"stargazers_count":37,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T06:35:11.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asmuth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-05-13T00:03:30.000Z","updated_at":"2023-04-20T05:48:54.000Z","dependencies_parsed_at":"2024-11-09T11:29:28.392Z","dependency_job_id":"ac48a889-da73-43f2-a063-52acd777f8c2","html_url":"https://github.com/asmuth/brokerd","commit_stats":{"total_commits":537,"total_committers":5,"mean_commits":107.4,"dds":0.0968342644320298,"last_synced_commit":"bbbae7512c5793320ca78ee7156e32bf166dfdb3"},"previous_names":["paulasmuth/fyrehose"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmuth%2Fbrokerd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmuth%2Fbrokerd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmuth%2Fbrokerd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmuth%2Fbrokerd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asmuth","download_url":"https://codeload.github.com/asmuth/brokerd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252563150,"owners_count":21768411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:29:03.768Z","updated_at":"2025-05-08T03:08:53.940Z","avatar_url":"https://github.com/asmuth.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"brokerd\n=======\n\nbrokerd is a minimalistic message broker service. A brokerd instance manages a\nnumber of \"channels\". Each channel maps to a file on disk and supports two\noperations: `append(channel, msg)` and `getnext(channel, offset)`. \n\nThe append operation appends a message at the end of the file. Messages are then\nidentified by the (logical) file offset at which they were written. The initial\noffset for the first message in a channel is zero and then increases monotonically\nwith each subsequent message.\n\nThe getnext operation reads a batch of messages from a channel starting at a given\noffset. When consuming messages from a channel the client is responsible for\nstoring the last offset it has consumed.\n\nIf a disk space limit is configured using `--disklimit`, old messages will\neventually be deleted from the beginning of the channel to reclaim space. When a\nclient tries to read a message (offset) that has been garbage collected, brokerd\nwill return the next valid message in the channel. Reading from offset zero is\ntherefore _always_ a valid operation and returns the first/oldest retained message\nfrom the channel.\n\n[Full Documentation](https://brokerd.org)\n\n\nGetting Started\n---------------\n\nExecute the following command to start brokerd on HTTP port 8080. The messages\nwill be stored in `/var/brokerd`:\n\n    $ mkdir /var/brokerd\n    $ brokerd --datadir /var/brokerd --listen_http localhost:8080\n\nIn a shell, run this command to insert the message \"testing\" into our channel (\nthe channel will be created on first insert):\n\n    curl -X POST -d \"testing\" localhost:8080/channel/testchan\n\nAfterwards, run this command to read messages from the \"testchan\" channel:\n\n    curl -v localhost:8080/channel/testchan\n\nThe output should look similar to this:\n\n    \u003c HTTP/1.1 200 OK\n    \u003c access-control-allow-origin: *\n    \u003c content-type: application/json; charset=utf-8\n    \u003c Content-Length: 944\n\n    [\n      {\n        \"offset\": 1,\n        \"next_offset\": 2,\n        \"data\": \"testing\"\n      },\n      {\n        \"offset\": 2,\n        \"next_offset\": 3,\n        \"data\": \"testing\"\n      },\n      {\n        \"offset\": 3,\n        \"next_offset\": 4,\n        \"data\": \"testing\"\n      },\n    ...\n\n\nHTTP API\n--------\n\nThe HTTP+JSON API is very simple. Below is a list of all API methods. For more\ndetailed documentation on the API please [check out the documentation](https://brokerd.org)\n\n    POST /channel/:channel\n         Append a message to a channel (the message is the POST body)\n\n     GET /channel/:channel/:offset\n         Retrieve a message at a specific offset\n\n     GET /channel/:channel/:offset/next\n         Retrieve the next message after a specific offset\n\n     GET /channel/:channel/:offset/next/:n\n         Retrieve the next N messages after a specific offset\n\n     GET /stats\n         Responds with a list of statistics\n\n     GET /serverid\n         Returns a unique server ID\n\n     GET /ping\n         Responds with 'pong'\n\n\nUsage\n-----\n\nThe brokerd distribution consists of two programs: `brokerd` and `brokerctl`.\nThe brokerd program is the main server program and the second brokerctl program\nis a simple command line client. For more information please\n[check out the documentation](https://brokerd.org)\n\n    Usage: $ brokerd [OPTIONS]\n       --listen_http \u003caddr\u003e          Listen for HTTP connection on this address\n       --datadir \u003cdir\u003e               Set the data directory\n       --disklimit \u003climit\u003e           Delete old messages to keep total size \u003c limit\n       --disklimit_channel \u003climit\u003e   Delete old messages to keep every channel size \u003c limit\n       --daemonize                   Daemonize the server\n       --pidfile \u003cfile\u003e              Write a PID file\n       --loglevel \u003clevel\u003e            Minimum log level (default: INFO)\n       --[no]log_to_syslog           Do[n't] log to syslog\n       --[no]log_to_stderr           Do[n't] log to stderr\n       -?, --help                    Display this help text and exit\n       -V, --version                 Display the version of this binary and exit\n\n    Examples:\n       $ brokerd --datadir /var/brokerd --listen_http localhost:8080\n       $ brokerd --datadir /var/brokerd --listen_http localhost:8080 --disklimit 20GB\n\n\nBuilding\n--------\n\nBefore we can start we need to install some build dependencies. Currently\nyou need a modern c++ compiler, libz and autotools.\n\n    # Ubuntu\n    $ apt-get install clang make automake autoconf libtool zlib1g-dev\n\n    # OSX\n    $ brew install automake autoconf\n\nTo build brokerd from a git checkout:\n\n    $ git clone git@github.com:paulasmuth/brokerd.git\n    $ cd brokerd\n    $ ./autogen.sh\n    $ ./configure\n    $ make V=1\n    $ sudo make install\n\n\nLicense\n-------\n\nCopyright (c) 2011 Paul Asmuth\n\nbrokerd  is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nFnordMetric is distributed in the hope that it will be useful,but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nFnordMetric. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmuth%2Fbrokerd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmuth%2Fbrokerd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmuth%2Fbrokerd/lists"}