akka / alpakka

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
https://doc.akka.io/docs/alpakka/current/
Other
1.26k stars 645 forks source link

Add support for AMPQ 1.0 #933

Open giftig opened 6 years ago

giftig commented 6 years ago

Hi, after a bit of playing around with using alpakka to connect to ActiveMQ, I discovered that the AMQP protocol used by alpakka-stream-alpakka-amqp doesn't match the protocol version used by ActiveMQ:

Caused by: com.rabbitmq.client.MalformedFrameException: AMQP protocol version mismatch; we are version 0-9-1, server sent signature 3,1,0,0

It seems AMQ doesn't support AMQP version 0.9.1, and I don't see anything in the alpakka documentation about different versions. Is this a known issue? Am I using the wrong connector?

giftig commented 6 years ago

I just spotted the clue in the error message, com.rabbitmq.client.MalformedFrameException. I take it the AMQP support is more specifically aimed at rabbitmq. I don't see anything about using a different underlying client, though, so is ActiveMQ simply not supported?

juanjoDiaz commented 6 years ago

The RabbitMQ client that we use works for any AMQP 0.9.1-compliant server, not only RabbitMQ.

However, it seems that ActiveMQ is using AMQP 1.0 and that's not supported at the moment.

giftig commented 6 years ago

Indeed, I also checked it from the other direction but it appears AMQ doesn't support 0.9.1 and has no intention of back-porting older protocol versions: http://activemq.2283324.n4.nabble.com/jira-Closed-AMQ-5332-Support-AMQP-0-9-1-td4686862.html

Since I'm playing around with alpakka in a new project and can choose whichever message queue I want, I simply used RabbitMQ instead of ActiveMQ. It'd be nice to have the more recent AMQP version supported, though.

juanjoDiaz commented 6 years ago

It would be nice indeed.

I think that the problem is that AMQP 1.0 is not "just the next version". It's pretty much a new protocol. So some brokers like RabbitMQ decided to stay on 0.9.

Maybe you can change the title to Add Support for AMQP 1.0 or something like that to make the issue more clear.

giftig commented 6 years ago

I'm not sure why AMQ announces its version as 3,1,0,0 if it's AMPQ 1.0, but done. I guess the numbering totally changed with specification v1, and it's not "just a new version", like you said.

ennru commented 6 years ago

Good to get this discussed. The least we can do for now is to add a section on supported versions in the docs for the AMQP connector.