2

I am trying to publish a message to rabbitmq. this works in production environment env with the same code so I suspect this is a configuration issue.

rbqueue = RabbitMQClientQueue('cn-dip-v3', host = rabbitmq_config['host'], username = rabbitmq_config['user'], password = rabbitmq_config['password'])

channel = rbqueue.connection.channel()
args = {"x-max-priority": 10}
channel.queue_declare(queue='cn-dip-v3', durable=True, arguments=args)

result = channel.queue_declare(exclusive=True)
callback_queue = result.method.queue

msgBody = json.dumps({"ohad":123})
# may happen that sendResponseToDal is True but there is no sendResponseToDal method on server side
data = {"body":msgBody,"queue_response" : False}
if responseHandler:
    data["queue_response"] = True

corrID = str(uuid.uuid4())

channel.basic_publish(exchange='',routing_key='cn-dip-v3',properties=pika.BasicProperties(priority = 10, reply_to = callback_queue,correlation_id = corrID,),body=json.dumps(data))

The queue_declare works . if I delete it and run the same line the queue gets defined. I see it in the management panel, which is oddly, in port 55672 and not 15672.

enter image description here

WebQube
  • 131
  • 5

1 Answers1

0

Turns out the answer was that it was an old installation. 2.8.4 in staging vs 3 in production .

installing the latest rabbit solved it. here is the installation script I used:

vim install_latest_rabbit.sh

#!/bin/sh
cat <<EOF > /etc/apt/sources.list.d/rabbitmq.list
deb http://www.rabbitmq.com/debian/ testing main
EOF

curl https://www.rabbitmq.com/rabbitmq-signing-key-public.asc -o /tmp/rabbitmq-signing-key-public.asc
apt-key add /tmp/rabbitmq-signing-key-public.asc
rm /tmp/rabbitmq-signing-key-public.asc

apt-get -qy update
apt-get -qy install rabbitmq-server

sudo rabbitmqctl add_user guest guest
sudo rabbitmqctl set_user_tags guest administrator
sudo rabbitmqctl set_permissions -p / guest ".*" ".*" ".*"

sudo sh install_latest_rabbit.sh
WebQube
  • 131
  • 5