GoLang - dial tcp 127.0.0.1:5672: connectex: No connection could be made because the target machine

3,240 views
Skip to first unread message

Vishal Kumar Singh

unread,
Apr 20, 2017, 5:33:13 AM4/20/17
to rabbitmq-users
I am new to GoLang and I am trying to use RabbitMQ with this. Connection is not getting established.

conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")

This is the line of code I m trying to establish the coonection

Error:

dial tcp 127.0.0.1:5672: connectex: No connection could be made because the target machine actively refused it
exit status 1



Michael Klishin

unread,
Apr 20, 2017, 5:59:08 AM4/20/17
to rabbitm...@googlegroups.com
You need to make sure that a RabbitMQ node is running locally and listening on port 5672 (which is the default).

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Apr 20, 2017, 6:00:31 AM4/20/17
to rabbitm...@googlegroups.com
Also, I'm not sure how the Go client handles vhosts but the vhost in your URI is "" (a blank string).
If you want to connect to the default one (/), either per-cent encode it as %2F or leave the slash out of the URI entirely:

amqp://guest:guest@localhost:5672
amqp://guest:guest@localhost:5672/%2F


On Thu, Apr 20, 2017 at 11:59 AM, Michael Klishin <mkli...@pivotal.io> wrote:
You need to make sure that a RabbitMQ node is running locally and listening on port 5672 (which is the default).
On Thu, Apr 20, 2017 at 11:33 AM, Vishal Kumar Singh <vishalkumarsingh1707@gmail.com> wrote:
I am new to GoLang and I am trying to use RabbitMQ with this. Connection is not getting established.

conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")

This is the line of code I m trying to establish the coonection

Error:

dial tcp 127.0.0.1:5672: connectex: No connection could be made because the target machine actively refused it
exit status 1



--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Vishal Kumar Singh

unread,
Apr 20, 2017, 7:35:00 AM4/20/17
to rabbitmq-users
Thanks. Its done


On Thursday, April 20, 2017 at 12:00:31 PM UTC+2, Michael Klishin wrote:
Also, I'm not sure how the Go client handles vhosts but the vhost in your URI is "" (a blank string).
If you want to connect to the default one (/), either per-cent encode it as %2F or leave the slash out of the URI entirely:

amqp://guest:guest@localhost:5672
amqp://guest:guest@localhost:5672/%2F

On Thu, Apr 20, 2017 at 11:59 AM, Michael Klishin <mkli...@pivotal.io> wrote:
You need to make sure that a RabbitMQ node is running locally and listening on port 5672 (which is the default).
On Thu, Apr 20, 2017 at 11:33 AM, Vishal Kumar Singh <vishalkuma...@gmail.com> wrote:
I am new to GoLang and I am trying to use RabbitMQ with this. Connection is not getting established.

conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")

This is the line of code I m trying to establish the coonection

Error:

dial tcp 127.0.0.1:5672: connectex: No connection could be made because the target machine actively refused it
exit status 1



--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages