I'm currently using ActiveMQ for my messaging needs; aside from a few db failures, it has worked well. However, I'm at the very least considering trying out RabbitMQ. But before I do, I'd like to understand the following:
JmsTemplate
and I use DefaultMessageListener
beans to connect queues to their respective handlers. Can I essentially do the same with RabbitMQ?RabbitMQ is the best performance wise according to me, but it does not have failover and recovery options. ActiveMQ has the most features, but is slower. Update : HornetQ is also an option you can look into, it is JMS Complaint, a better option than ActiveMQ if you are looking for a JMS based solution.
ActiveMQ is used in enterprise projects to store multiple instances and supports clustering environments based on the JMS messaging specification. RabbitMQ is a message broker which is executed in low-level AMQP protocol and acts as an intermediator between two application in the communication process.
ActiveMQ supports the AMQP 1.0 protocol which is an OASIS standard. Available from ActiveMQ version 5.8 onward.
Kafka offers much higher performance than message brokers like RabbitMQ. It uses sequential disk I/O to boost performance, making it a suitable option for implementing queues. It can achieve high throughput (millions of messages per second) with limited resources, a necessity for big data use cases.
RabbitMQ is an AMQP broker, while ActiveMQ is a JMS one. I suggest you read the AMQP wikipedia article to get an idea of the concepts used in AMQP, which are different than the ones you're familiar in JMS. One of the main difference is that in AMQP a producer sends to an exchange without knowing the actual message distribution strategy while in JMS the producer targets either a queue or a topic (thus being aware of the type of message routing in place). So it's hard to tell what's done better or worse, as the semantics are very different between JMS and AMQP.
RabbitMQ's queues and exchanges are all configured via the AMQP protocol so a client library allows you to configure all your destinations and their behavior. ActiveMQ requires specific destination configuration because the JMS spec doesn't cover any of the administration side of things. Besides that, RabbitMQ's system configuration is Erlang-esque, while ActiveMQ is usually configured in XML. So you'll have to get used to the {tuple} and <> lovely syntax. RabbitMQ is usually installed with OS packages, while ActiveMQ distributions are archives you drop anywhere (or Maven deps you embed into something else).
Very well :) See Spring AMQP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With