Skip to content

Commit 92d3805

Browse files
committed
send message to backend
1 parent 37af9fb commit 92d3805

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

deploy/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
depends_on:
1414
- zookeeper
1515
ports:
16-
- 29093:29092
16+
- 29092:29092
1717
environment:
1818
KAFKA_BROKER_ID: 1
1919
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

src/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ def __init__(self):
99

1010
self.running = True
1111

12-
self.producer_thread = ProducerThread("localhost:29093")
12+
self.producer_thread = ProducerThread("localhost:29092")
1313

14-
self.consumer_thread = ConsumerThread("localhost:29093")
15-
self.consumer_thread.add_topics("test", self.on_callback_test)
14+
self.consumer_thread = ConsumerThread("localhost:29092")
15+
self.consumer_thread.add_topics("analyse", self.on_callback_test)
1616

1717
self.consumer_thread.start()
1818
self.producer_thread.start()
1919

2020

2121
def on_callback_test(self, topic, data):
2222
print("message receive : ", topic, data)
23-
print("a")
23+
24+
self.producer_thread.send("analyse_report", "test")
2425

2526
def run(self):
2627

0 commit comments

Comments
 (0)