https://github.com/bborbe/sample_kafka_consumer
https://github.com/bborbe/sample_kafka_consumer
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bborbe/sample_kafka_consumer
- Owner: bborbe
- Created: 2025-03-12T15:18:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-16T14:07:36.000Z (about 1 year ago)
- Last Synced: 2025-04-16T21:08:58.424Z (about 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kafka
## Setup Python
### install pyenv
```bash
curl -fsSL https://pyenv.run | bash
```
zsh:
```
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
```
### install python
```
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"
sudo pyenv install 3.11.4
```
### Create pyenv
```bash
pyenv virtualenv 3.11.4 sample_kafka_consumer
pyenv local sample_kafka_consumer
```
```bash
pip install -r requirements.txt
```
## Run
```bash
make run
```
```bash
make runtls
```
## Send Message
http://localhost:9090/sendmessage
## Doc
https://docs.confluent.io/platform/current/clients/confluent-kafka-python/html/index.html
# Get SSL Certs
# kubectl -n strimzi get secret my-cluster-cluster-ca-cert -o jsonpath='{.data.ca\.crt}' | base64 -d > ca.crt
```bash
kubectl -n strimzi get secret test -o jsonpath='{.data.ca\.crt}' | base64 -d > ca.crt
kubectl -n strimzi get secret test -o jsonpath='{.data.user\.key}' | base64 -d > user.key
kubectl -n strimzi get secret test -o jsonpath='{.data.user\.crt}' | base64 -d > user.crt
```