https://github.com/lsevero/trivial-kafka-async
Trivial kafka client with core.async support
https://github.com/lsevero/trivial-kafka-async
Last synced: 2 months ago
JSON representation
Trivial kafka client with core.async support
- Host: GitHub
- URL: https://github.com/lsevero/trivial-kafka-async
- Owner: lsevero
- License: epl-2.0
- Created: 2021-05-26T18:33:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T15:03:04.000Z (over 3 years ago)
- Last Synced: 2025-01-20T18:44:54.827Z (4 months ago)
- Language: Clojure
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# trivial-kafka-async
A simple kafka client using core.async
[](https://clojars.org/org.clojars.lsevero/trivial-kafka-async)
## Usage
Just instantiate `producer!`s and `consumer!`s when you need.
Both those functions return a `core.async/chan`.To send send a message to topic, send a message to the producer channel returned by `producer!`.
To receive a message from a topic, read the messages on the consumer channel returned by `consumer!`.
There is also a `worker!` facility that consumes a consumer channel and apply a function to each message received.
## Troubleshooting
### Unresponsive kafka channels
core.async default pool-size may be too small if you have to many producers and consumers instantiated.
To increase the pool size you'll need to pass this java property to your app, or in java or in `:jvm-opts` project.clj lein section:
`-Dclojure.core.async.pool-size=`
The default for this property is 8.## Working example
See [kafka-client-template](https://github.com/lsevero/kafka-client-template)
## License
Copyright © 2021 Lucas Severo
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.