Discussion:
[Scikit-learn-general] Message to Rabbit MQ
Startup Hire
2016-02-02 11:24:27 UTC
Permalink
Hi all,

This is not exactly a scikit-learn question but I am trying to send the
output of a model into an exchange of Rabbit MQ.

I will convert the dataframe into json before sending it to the exchange.

This sample code is not sending messages. Any ideas?


#!/usr/bin/env python
import pika
credentials = pika.PlainCredentials('admin', '')
connection = pika.BlockingConnection(pika.ConnectionParameters(
'<....>,'/',credentials))
channel = connection.channel()

## have masked the password and ip details above

channel.basic_publish(exchange='CRM:TripPropensityUpdated',
routing_key='',
body='Hello World',
properties=pika.BasicProperties(
delivery_mode = 1, # make message persistent
))
print (channel.basic_ack(delivery_tag = 1,multiple=1))


*The final output is None *which means the message is not being sent.

Regards,
Sanant

Loading...