Not able to connect to RabbitMQ using Php

0

Hi,

I'm trying to connect the RabbitMQ using php, and getting error. PhpAmqpLib\Exception\AMQPDataReadException: Error receiving data in /Users/surya/projects/rabbitmq/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:184

However, I'm able to connect to any other local instance/ docker instance using the same code. I'm following the guidelines present on the RabbitMQ Official Tutorials.
https://www.rabbitmq.com/tutorials/tutorial-one-php.html

What I can?

  1. Telnet to the 5671 and 15671 Port. - Success.
  2. Open the Management console using the UI and successful login.

Please let me know, incase any other information is required from my side.

Thanks,
Surya

asked 3 years ago1275 views
2 Answers
0

Hi,

I have tried to use (Pika) Python Library to connect RabbitMQ, it's not connecting using the Python as well.
Error:
pika.exceptions.IncompatibleProtocolError: StreamLostError: ("Stream connection lost: ConnectionResetError(54, 'Connection reset by peer')",)

I have checked the security group and allowed all the port for inbound and outbound.

Please let me know, how can I troubleshoot further.

Thanks,
Surya

answered 3 years ago
0

Hi,

I have tried to figure out by myself. It's not connecting using the
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))

It's working using below method.

#Python using Pika
url_parameters = pika.URLParameters('amqps://user:password@aws-hostname:5671/')
connection = pika.BlockingConnection(url_parameters)

Thanks,
Surya

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions