liveBook · Manning

Chapter 13: Chapter 13. Tuning ActiveMQ for performance

What you will learn in chapter 13 of ActiveMQ in Action

This introduction outlines factors affecting ActiveMQ performance and describes two architectural choices that can improve it.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction outlines factors affecting ActiveMQ performance and describes two architectural choices that can improve it.

Key terms: broker network topology, transport, quality of service, Java Virtual Machine, guaranteed delivery, nonpersistent messaging, embedded brokers, serialization

13.1 General techniques

This section introduces two performance approaches and their applicability to different messaging reliability needs.

Key terms: nonpersistent messaging, transactions, guaranteed messaging, reliable delivery

13.1.1 Persistent versus nonpersistent messages

This section compares persistent and nonpersistent message delivery, their performance trade-offs, and ActiveMQ’s additional reliability measures.

Key terms: persistent delivery, nonpersistent delivery, message store, MessageProducer, asynchronously, receipt, failover transport, trackMessages, message auditing, guaranteed message delivery

13.1.2 Transactions

This section explains how transaction boundaries and embedded brokers can improve ActiveMQ performance.

Key terms: transaction boundary, Session.commit(), synchronous communication, persistent messages, embedded broker, serialization, network traffic, JVM

13.1.3 Embedding brokers

This section explains how embedding an ActiveMQ broker and tuning message copying can improve performance for co-located applications.

Key terms: embedded broker, VM transport, co-locate, transport connector, TCP transport, vm://<broker name>, QueueRequestor, copyMessageOnSend, ActiveMQConnectionFactory, message producer

13.1.4 Tuning the OpenWire protocol

This section introduces OpenWire’s role in broker communication and explains how to approach its performance tuning.

Key terms: OpenWire protocol, commands, transport, TCP, OpenWire wire format parameters, URI, tight encoding

13.1.5 Tuning the TCP transport

This section explains two TCP transport settings that can affect ActiveMQ performance and recommends testing their effects on the operating system.

Key terms: TCP transport, socketBufferSize, tcpNoDelay, TCP socket

13.2 Optimizing message producers

This section introduces the importance of producer-to-broker message rates for overall application performance.

Key terms: producers, message broker, overall application performance

13.2.1 Asynchronous send

This section explains how asynchronous sends improve producer performance and relates delivery choices to reliability requirements.

Key terms: useAsyncSend, connection factory, MessageProducer, persistent messages, nonpersistent delivery, failover transport cache, persistent delivery, transactions, guaranteed delivery

13.2.2 Producer flow control

This section explains how producer flow control protects broker resources and how to configure its performance and blocking trade-offs.

Key terms: producer flow control, usage limits, temporary store space, producerWindowSize, asynchronous publishing, send buffer, transport, destination policy, temporary storage, system usage memory limit

13.3 Optimizing message consumers

This section introduces consumers’ role in ActiveMQ performance and describes how messages reach and wait in consumer sessions.

Key terms: message consumers, message producers, acknowledge, consumer connections, transport, session, queued

13.3.1 Prefetch limit

This section explains how ActiveMQ prefetch limits control consumer delivery and how to choose and configure them.

Key terms: push-based model, prefetch limit, in-flight messages, acknowledgement, prefetch size, queue, slow consumer, topics, ActiveMQConnectionFactory, destination property

13.3.2 Delivery and acknowledgment of messages

This section compares message delivery and acknowledgment approaches for consumer performance, including the throughput and duplicate-delivery tradeoff.

Key terms: MessageListener, onMessage(), MessageConsumer, receive(), prefetch limits, message acknowledgment, Session.commit(), auto-acknowledgment, DUPS_OK_ACKNOWLEDGE, optimizeAcknowledge

13.3.3 Asynchronous dispatch

This section explains how disabling asynchronous session dispatch can reduce message-consumption overhead.

Key terms: asynchronous dispatch, alwaysSessionAsync, ActiveMQ ConnectionFactory, internal queue, transport, message consumer

13.4 Tuning in action

This section combines broker, producer, and consumer settings in a tuned real-time data-feed example.

Key terms: embedded broker, VM transport, nonpersistent messages, message copy, memory limit, PolicyEntry, default entry, flow control, destination, straight-through processing

13.5 Summary

Concepts explained in this chapter

← Chapter 12: Chapter 12. Advanced client options Chapter 14: Chapter 14. Administering and monitoring ActiveMQ →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.