14 lines
361 B
Python
14 lines
361 B
Python
from pika import BlockingConnection, ConnectionParameters
|
|
|
|
|
|
def mess():
|
|
connection = BlockingConnection(ConnectionParameters('rabbitmq'))
|
|
channel = connection.channel()
|
|
|
|
channel.queue_declare(queue='rating')
|
|
channel.basic_publish(
|
|
exchange='',
|
|
routing_key='rating',
|
|
body='{news_id:127.0.0.1}'
|
|
)
|
|
connection.close() |