Does spring integration support AMQP with ActiveMq - activemq

I am new to the MOM.
I want to connect to ActiveMQ using AMQP from my application.
Also I want to use Spring Integration for connecting to the ActiveMq.
I see example of AMQP for rabbitMQ but I am not able to find any example for ActiveMq.
Is it not possible to do with Spring Integration ?

No, it isn't possible.
ActiveMQ supports the AMQP 1.0 protocol which is an OASIS standard.
Where RabbitMQ and hence Spring Integration AMQP adapters support 0.9.1.
Those Spec versions are very different.
You should try tu use ActiveMQ JMS API over its AMQP. And finally Spring Integration JMS adapters.

Related

Apache ActiveMQ integration with different version

Currently we are using ActiveMQ 5.15.6. Can this version be integrate with 5.16.4 where one is the provider and the other is the consumer of JMS messages?
Yes. The integration you describe should work.

How to find the version of AMQP protocol used in ActiveMQ

Is there any way to check the version (1.0 or 0.9.1) of AMQP that is being used by ActiveMQ. I'm using ActiveMQ 5.16.3.
In the RabbitMQ console there is a way to view the version of AMQP protocol that is being connected. I want to check if there are any ways to verify the version of AMQP protocol that is being connected in the ActiveMQ web console.
ActiveMQ "Classic" (i.e. 5.x) only supports AMQP 1.0. See the documentation for more details.
There is no way to see the protocol version in the web console and really no need since only AMQP 1.0 is supported.

Code example of Spring AMQP + ActiveMQ without reliance on JMS API

Is there any working source code example of Spring AMQP + ActiveMQ (sender + receiver) without any reliance on the JMS API?
Note: The reason for this question is because Spring already lists JMS as a deprecated transport protocol for remoting (only AMQP and web-service calls are still actively supported).
As noted on the Spring AMQP GitHub project page:
This project provides support for using Spring and Java with AMQP 0.9.1, and in particular RabbitMQ.
ActiveMQ (both classic and Artemis) supports AMQP 1.0 (standardized by ISO) and not 0.9.1 (not standardized). Therefore you can't use Spring AMQP with ActiveMQ. The Spring AMQP project is really only useful for integrating with RabbitMQ.

How to produce basic.return with QPid

I use rabbitmq in production and QPid in integration tests. I need to write integration test which verify that return channel is called for unroutable messages. I set mandatory=true and unbind queue and exchange, however nack channel is called (NackedAmqpMessageException is thrown) instead of return channel. Return channel is never called.
I use Spring AMQP with Spring Boot + Spring Integration. How can I produce return channel case in tests?
I use the versions:
Qpid 7.1.4
Amqp client 5.4.3
Spring Integration 5.1.9
Spring Boot 2.1.2
Thank you.
Is there a confirmation that QPid supports Publisher Confirms: https://www.rabbitmq.com/confirms.html#publisher-confirms ? To be honest we recommend to use RabbitMQ even for tests. See our recent sample how to do that with Testcontaniers: https://github.com/spring-projects/spring-integration-samples/tree/master/intermediate/testcontainers-rabbitmq

RabbitMQ Camel and STOMP

I successfully completed a POC using Spring Reactor Netty Stomp client (Spring messaging framework) to connect to RabbitMQ on port 61613 (port dedicated for STOMP). That was just a POC. Now I have to build something concrete to be able to deploy in prod environments. I was Googling Spring Messaging vs Spring Integration and stumbled upon Apache Camel.
RabbitMQ component page in the Camel documentation talks about port 5672 and that is AMQP. The STOMP component page talks about ActiveMQ.
I did not see any examples or documentation regarding Camel in conjunction with RabbitMQ and STOMP.
Can Apache Camel be used to connect to RabbitMQ on port 61613?
The Camel documentation for the STOMP component states:
The Stomp component is used for communicating with Stomp compliant message brokers, like Apache ActiveMQ or ActiveMQ Apollo.
Notice that it says like Apache ActiveMQ. It doesn't say it has to be Apache ActiveMQ. It just uses ActiveMQ as an example of a "Stomp compliant" message broker. If RabbitMQ supports STOMP then Camel's STOMP component should work without issue.
Looking at Camel's StompEndpoint it clearly uses the brokerURL from the configuration to make the connection to the Stomp broker. It uses the Fusesource Stomp client implementation which should work with any Stomp compliant broker.
It's also worth noting that Camel is an integration framework and Stomp is a simple, open messaging protocol so it doesn't make much sense for the Stomp component within Camel to only work with a couple of ActiveMQ brokers. It can (and will) work with any Stomp compliant broker (just as the documentation states).