Bobby Battista
Bobby Battista

Reputation: 2075

Connect to Active MQ with golang

Amazon MQ (Active MQ) says it works with amqp, and there's a go package here https://github.com/streadway/amqp but when I try to Dial() I get this error

Exception (501) Reason: "Exception (501) Reason: \"frame could not be parsed\""

I suspect it is because although this is an amqp package, and Amazon MQ accepts amqp, this is specifically a RabbitMQ amqp package... does this make sense?

Another option is STOMP, which I've tried using the example here https://github.com/go-stomp/stomp/blob/master/examples/client_test/main.go But Dial() is giving me this super not helpful error: "invalid command"

It's embarrassing asking how to connect, but it's where I'm stuck. Thanks in advance

Upvotes: 7

Views: 10081

Answers (3)

Hari Krishnan U M
Hari Krishnan U M

Reputation: 1

Make sure you are using amqps:// instead of amqp://, as Amazon MQ need a secure connection.

Upvotes: 0

Tim Bish
Tim Bish

Reputation: 18376

You need an AMQP 1.0 client library. The Qpid project at Apache maintains several different language bindings for AMQP 1.0 one of which is a Go client and is documented here and some examples here.

For the STOMP attempt it could be you are not attempting to connect to the correct port on the broker, which can lead to clients giving you that error. The STOMP port is typically 61613, and AMQP is 5672.

Upvotes: 2

Petter Nordlander
Petter Nordlander

Reputation: 22279

AMQP 0.x (RabbitMQ) is a very different protocol from AMQP 1.0 (ActiveMQ, etc). AMQP 1.0 is not backwards compatible.

You need a client library that supports AMQP 1.0.

I have not tested it, but this lib claims to work. https://github.com/vcabbage/amqp

Upvotes: 4

Related Questions