Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pub-sub-stream/receiver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import json
import time
from queue import Queue
from threading import Thread
import time

import mysql.connector
import MySQLdb

from model.biography import Biography
from streamchannel.streams import polling_consumer, cancellation_token
from streamchannel.streams import cancellation_token, polling_consumer


def map_from_message(message_body: str) -> Biography:
Expand All @@ -15,8 +15,8 @@ def map_from_message(message_body: str) -> Biography:


def handle_message(bio: Biography) -> bool:
mydb = mysql.connector.connect(
host="localhost",
mydb = MySQLdb.connect(
host="localhost", # try host="127.0.0.1" if failing to connect to MySQL running in Docker
user="root",
password="root",
database="Lookup"
Expand Down
2 changes: 1 addition & 1 deletion pub-sub-stream/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
confluent-kafka==2.3.0
mysqlclient==2.2.1
mysqlclient==2.2.4