Need advice about which tool to choose?Ask the StackShare community!

ActiveMQ

609
1.3K
+ 1
77
ZeroMQ

260
585
+ 1
71
Add tool

ActiveMQ vs ZeroMQ: What are the differences?

Introduction

ActiveMQ and ZeroMQ are both popular messaging frameworks used in software development. While they share similarities in their purpose of enabling communication between different components or systems, they have distinct differences that set them apart. In this article, we will discuss the key differences between ActiveMQ and ZeroMQ.

  1. Built-in Broker vs. Brokerless Architecture: ActiveMQ is a message broker that acts as a mediator between senders and receivers. It provides a centralized messaging infrastructure where messages are sent to the broker and then delivered to their intended destinations. On the other hand, ZeroMQ follows a brokerless architecture, where messaging is performed directly between senders and receivers without the need for a centralized broker.

  2. Transport Protocols: ActiveMQ primarily uses open wire protocols, which are based on XML and are platform-independent. It also supports other protocols such as STOMP, MQTT, and AMQP. In contrast, ZeroMQ utilizes its own proprietary protocol called ZeroMQ or simply ZMQ protocol. This protocol is lightweight and designed for high-performance messaging between applications.

  3. Programming Language Support: ActiveMQ is primarily implemented in Java and provides client libraries for several programming languages, including Java, C++, .NET, and others. These client libraries enable developers to interact with ActiveMQ using their preferred language. In contrast, ZeroMQ is implemented in C++, but it also provides bindings for various programming languages such as Java, C#, Python, and more.

  4. Message Patterns: ActiveMQ supports various messaging patterns such as point-to-point (queue-based) and publish/subscribe (topic-based) patterns. It provides features like message acknowledgment and durable subscriptions. ZeroMQ, on the other hand, supports a wide range of messaging patterns, including request/reply, publish/subscribe, multicast, and pipeline patterns. It offers fine-grained control over message routing and allows developers to build custom messaging patterns.

  5. Scalability and Performance: ActiveMQ leverages a traditional centralized messaging model, which can introduce potential bottlenecks as the number of clients and messages increases. It relies on the broker to handle message queueing and delivery. In contrast, ZeroMQ's brokerless architecture allows for better scalability and performance. It supports peer-to-peer communication, allowing messages to be sent directly between applications without relying on a centralized broker.

  6. Ease of Setup and Configuration: ActiveMQ is a feature-rich messaging system that requires installation and configuration of a message broker. Setting up and managing a standalone ActiveMQ server can involve some complexity. In contrast, ZeroMQ is a lightweight library that can be easily integrated into existing applications. It does not require a separate server or complex configuration, making it easier to set up and use in comparison.

In summary, ActiveMQ and ZeroMQ differ in their architecture, transport protocols, language support, message patterns, scalability and performance, as well as ease of setup and configuration. Each framework has its own strengths and use cases, and the choice between them depends on specific project requirements and constraints.

Advice on ActiveMQ and ZeroMQ
Meili Triantafyllidi
Software engineer at Digital Science · | 6 upvotes · 476.2K views
Needs advice
on
Amazon SQSAmazon SQSRabbitMQRabbitMQ
and
ZeroMQZeroMQ

Hi, we are in a ZMQ set up in a push/pull pattern, and we currently start to have more traffic and cases that the service is unavailable or stuck. We want to: * Not loose messages in services outages * Safely restart service without losing messages (ZeroMQ seems to need to close the socket in the receiver before restart manually)

Do you have experience with this setup with ZeroMQ? Would you suggest RabbitMQ or Amazon SQS (we are in AWS setup) instead? Something else?

Thank you for your time

See more
Replies (2)
Shishir Pandey
Recommends
on
RabbitMQRabbitMQ

ZeroMQ is fast but you need to build build reliability yourself. There are a number of patterns described in the zeromq guide. I have used RabbitMQ before which gives lot of functionality out of the box, you can probably use the worker queues example from the tutorial, it can also persists messages in the queue.

I haven't used Amazon SQS before. Another tool you could use is Kafka.

See more
Kevin Deyne
Principal Software Engineer at Accurate Background · | 5 upvotes · 216.4K views
Recommends
on
RabbitMQRabbitMQ

Both would do the trick, but there are some nuances. We work with both.

From the sound of it, your main focus is "not losing messages". In that case, I would go with RabbitMQ with a high availability policy (ha-mode=all) and a main/retry/error queue pattern.

Push messages to an exchange, which sends them to the main queue. If an error occurs, push the errored out message to the retry exchange, which forwards it to the retry queue. Give the retry queue a x-message-ttl and set the main exchange as a dead-letter-exchange. If your message has been retried several times, push it to the error exchange, where the message can remain until someone has time to look at it.

This is a very useful and resilient pattern that allows you to never lose messages. With the high availability policy, you make sure that if one of your rabbitmq nodes dies, another can take over and messages are already mirrored to it.

This is not really possible with SQS, because SQS is a lot more focused on throughput and scaling. Combined with SNS it can do interesting things like deduplication of messages and such. That said, one thing core to its design is that messages have a maximum retention time. The idea is that a message that has stayed in an SQS queue for a while serves no more purpose after a while, so it gets removed - so as to not block up any listener resources for a long time. You can also set up a DLQ here, but these similarly do not hold onto messages forever. Since you seem to depend on messages surviving at all cost, I would suggest that the scaling/throughput benefit of SQS does not outweigh the difference in approach to messages there.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of ActiveMQ
Pros of ZeroMQ
  • 18
    Easy to use
  • 14
    Open source
  • 13
    Efficient
  • 10
    JMS compliant
  • 6
    High Availability
  • 5
    Scalable
  • 3
    Distributed Network of brokers
  • 3
    Persistence
  • 3
    Support XA (distributed transactions)
  • 1
    Docker delievery
  • 1
    Highly configurable
  • 0
    RabbitMQ
  • 23
    Fast
  • 20
    Lightweight
  • 11
    Transport agnostic
  • 7
    No broker required
  • 4
    Low level APIs are in C
  • 4
    Low latency
  • 1
    Open source
  • 1
    Publish-Subscribe

Sign up to add or upvote prosMake informed product decisions

Cons of ActiveMQ
Cons of ZeroMQ
  • 1
    ONLY Vertically Scalable
  • 1
    Support
  • 1
    Low resilience to exceptions and interruptions
  • 1
    Difficult to scale
  • 5
    No message durability
  • 3
    Not a very reliable system - message delivery wise
  • 1
    M x N problem with M producers and N consumers

Sign up to add or upvote consMake informed product decisions

What is ActiveMQ?

Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License.

What is ZeroMQ?

The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.

Need advice about which tool to choose?Ask the StackShare community!

What companies use ActiveMQ?
What companies use ZeroMQ?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with ActiveMQ?
What tools integrate with ZeroMQ?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

What are some alternatives to ActiveMQ and ZeroMQ?
RabbitMQ
RabbitMQ gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
Kafka
Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
Apollo
Build a universal GraphQL API on top of your existing REST APIs, so you can ship new application features fast without waiting on backend changes.
IBM MQ
It is a messaging middleware that simplifies and accelerates the integration of diverse applications and business data across multiple platforms. It offers proven, enterprise-grade messaging capabilities that skillfully and safely move information.
MySQL
The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
See all alternatives