https://github.com/graphform/nstream-machine-demo-producer
Kafka producer for simulating a manufacturing workflow.
https://github.com/graphform/nstream-machine-demo-producer
Last synced: 9 months ago
JSON representation
Kafka producer for simulating a manufacturing workflow.
- Host: GitHub
- URL: https://github.com/graphform/nstream-machine-demo-producer
- Owner: graphform
- License: apache-2.0
- Created: 2023-06-16T14:58:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T16:09:02.000Z (almost 3 years ago)
- Last Synced: 2025-06-23T03:54:30.840Z (12 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
This project is used to produce simulated machine data to a Kafka topic.
## Configuration
Any environment variable that is prefixed with `KAFKA_` will be passed as config to the Kafka
producer. For example `KAFKA_BOOTSTRAP_SERVERS` will be passed as `bootstrap_servers` to the python
KafkaProducer class.
## Minimal Config
This configuration will work on a Kafka Cluster that does not have security configured.
| Environment Variable | Value |
|-------------------------|------------|
| KAFKA_BOOTSTRAP_SERVERS | kafka:9092 |
| TOPIC | testing |
## Kubernetes Example
This configuration will work on a Kafka Cluster that does not have security configured.
```yaml
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: demo-kafka
namespace: demo-kafka
spec:
replicas: 1
selector:
matchLabels:
demo: kafka
serviceName: demo
template:
metadata:
labels:
demo: kafka
spec:
containers:
- image: nstream/nstream-machine-demo-producer:0.0.1
imagePullPolicy: Always
name: demo
env:
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-01:9071
- name: TOPIC
value: testing
resources:
limits:
cpu: ".5"
memory: 256Mi
requests:
cpu: ".5"
memory: 256Mi
```