mirror of https://github.com/dapr/quickstarts.git
updated topic name
This commit is contained in:
parent
6c46e83035
commit
9340d7624f
|
|
@ -1,15 +1,15 @@
|
|||
apiVersion: actions.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: sith
|
||||
name: sample
|
||||
spec:
|
||||
type: bindings.kafka
|
||||
metadata:
|
||||
- name: topics
|
||||
value: sith
|
||||
value: sample
|
||||
- name: brokers
|
||||
value: 10.0.181.114:9092
|
||||
- name: consumerGroup
|
||||
value: group1
|
||||
- name: publishTopic
|
||||
value: sith
|
||||
value: sample
|
||||
|
|
@ -10,7 +10,7 @@ services:
|
|||
- "9092:9092"
|
||||
environment:
|
||||
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
|
||||
KAFKA_CREATE_TOPICS: "sith:1:1"
|
||||
KAFKA_CREATE_TOPICS: "sample:1:1"
|
||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
|
@ -8,7 +8,7 @@ app.use(bodyParser.json());
|
|||
const port = 3000;
|
||||
|
||||
|
||||
app.post('/sith', (req, res) => {
|
||||
app.post('/sample-topic', (req, res) => {
|
||||
console.log("Hello from Kafka!");
|
||||
console.log(req.body);
|
||||
res.status(200).send();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
apiVersion: actions.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: sith
|
||||
name: sample-topic
|
||||
spec:
|
||||
type: bindings.kafka
|
||||
metadata:
|
||||
- name: topics
|
||||
value: sith
|
||||
value: sample-topic
|
||||
- name: brokers
|
||||
value: localhost:9092
|
||||
- name: consumerGroup
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import time
|
|||
import requests
|
||||
import os
|
||||
|
||||
actions_url = "http://localhost:5000/v1.0/bindings/sith"
|
||||
actions_url = "http://localhost:5000/v1.0/bindings/sample-topic"
|
||||
n = 0
|
||||
while True:
|
||||
n += 1
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
apiVersion: actions.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: sith
|
||||
name: sample-topic
|
||||
spec:
|
||||
type: bindings.kafka
|
||||
metadata:
|
||||
- name: brokers
|
||||
value: localhost:9092
|
||||
- name: publishTopic
|
||||
value: sith
|
||||
value: sample-topic
|
||||
Loading…
Reference in New Issue