Company
Date Published
Author
David M. Lentz
Word count
5904
Language
English
Hacker News points
None

Summary

ActiveMQ is a message-oriented middleware (MOM) system that allows for loose coupling of services in an application. It is a Java-based open-source project developed by the Apache Software Foundation and currently offers two versions: Classic and Artemis. ActiveMQ sends messages between client applications using standards-based, asynchronous communication. The broker routes each message through a messaging endpoint called a destination. Both ActiveMQ versions are capable of point-to-point messaging and publish/subscribe (pub/sub) messaging. The system implements the Java Message Service (JMS) API, which defines a standard for creating, sending, and receiving messages. ActiveMQ sends messages asynchronously, so consumers don't necessarily receive messages immediately. The producer's task is disconnected from the consumer's task of fetching it. This type of arrangement, in which clients function without knowledge of one another, is known as loose coupling. The benefits of loose coupling include high throughput, flexibility, and heterogeneity. Because the components of the ActiveMQ architecture are decoupled, you need to monitor producers, consumers, destinations, addresses, and brokers holistically to understand the context of any issues that may arise. Each message ActiveMQ sends is based on the JMS specification, and is made up of headers, optional properties, and a body. The content of an ActiveMQ message can be text or binary data. ActiveMQ uses memory to store messages awaiting dispatch to consumers, and each message occupies some memory until it is dequeued and delivered to a consumer. When producers are faster than consumers, ActiveMQ's memory use increases. ActiveMQ also writes messages to disk for storage. The system monitors several key metrics, including MemoryPercentUsage (Classic) / AddressSize (Artemis), ConsumerCount, ProducerCount, QueueSize (Classic) / MessageCount (Artemis), ExpiredCount (Classic) / MessagesExpired (Artemis), and various JVM metrics. These metrics can help you proactively maintain your messaging infrastructure, providing information you need to investigate errors, missing messages, and unexpected latency.