https://github.com/loopbackio/loopback4-example-kafka
A LoopBack 4 example application for Kafka integration
https://github.com/loopbackio/loopback4-example-kafka
Last synced: 9 months ago
JSON representation
A LoopBack 4 example application for Kafka integration
- Host: GitHub
- URL: https://github.com/loopbackio/loopback4-example-kafka
- Owner: loopbackio
- License: mit
- Created: 2018-10-30T18:06:59.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:32:45.000Z (about 2 years ago)
- Last Synced: 2025-04-19T22:02:46.471Z (9 months ago)
- Language: TypeScript
- Size: 23.4 KB
- Stars: 11
- Watchers: 14
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# loopback4-example-kafka
A LoopBack 4 example application for Kafka integration.
See related issues:
- https://github.com/strongloop/loopback-next/issues/1925
- https://github.com/strongloop/loopback-next/issues/1884
## Getting started
### Start a Kafka instance
```sh
docker-compose up
```
### Start the application
```sh
npm start
```
Now you can try out on http://localhost:3000/explorer.
To use `curl`:
- Create new topics
```sh
curl -X POST "http://127.0.0.1:3000/topics" -H "accept: */*" -H "Content-Type: application/json" -d "[\"demo\"]"
```
- Publish messages to `demo` topic:
```sh
curl -X POST "http://127.0.0.1:3000/topics/demo/messages" -H "accept: */*" -H "Content-Type: application/json" -d "[\"test messsage\"]"
```
- Receive messages from `demo` topic:
```sh
curl -X GET "http://127.0.0.1:3000/topics/demo/messages?limit=3" -H "accept: */*"
```
[![LoopBack]()](http://loopback.io/)