tobby48 4 роки тому
джерело
коміт
11b631220e

+ 1
- 1
src/main/python/kr/co/swh/lecture/opensource/rabbitmq/receive.py Переглянути файл

@@ -9,7 +9,7 @@ class Consumer:
9 9
         self.__queue = 'py'; 
10 10
     
11 11
     def on_message(channel, method_frame, header_frame, body): 
12
-        print('Received %s' % body) 
12
+        print('Received %s' % body.decode()) 
13 13
     
14 14
     def main(self): 
15 15
         conn = pika.BlockingConnection(pika.ConnectionParameters(self.__url, self.__port, self.__vhost, self.__cred)) 

+ 1
- 1
src/main/python/kr/co/swh/lecture/opensource/rabbitmq/send.py Переглянути файл

@@ -11,7 +11,7 @@ class Publisher:
11 11
     def main(self): 
12 12
         conn = pika.BlockingConnection(pika.ConnectionParameters(self.__url, self.__port, self.__vhost, self.__cred)) 
13 13
         chan = conn.channel() 
14
-        chan.basic_publish( exchange = '', routing_key = self.__queue, body = 'Hello RabbitMQ' ) 
14
+        chan.basic_publish( exchange = '', routing_key = self.__queue, body = '하이'.encode('utf-8') ) 
15 15
         conn.close() 
16 16
 
17 17
 publisher = Publisher()