HornetQ 2.1 User Manual

Putting the buzz in messaging


Table of Contents

1. Legal Notice
2. Preface
3. Project Information
3.1. Software Download
3.2. Project Information
4. Messaging Concepts
4.1. Messaging Concepts
4.2. Messaging styles
4.2.1. The Message Queue Pattern
4.2.2. The Publish-Subscribe Pattern
4.3. Delivery guarantees
4.4. Transactions
4.5. Durability
4.6. Messaging APIs and protocols
4.6.1. Java Message Service (JMS)
4.6.2. System specific APIs
4.6.3. RESTful API
4.6.4. STOMP
4.6.5. AMQP
4.7. High Availability
4.8. Clusters
4.9. Bridges and routing
5. Architecture
5.1. Core Architecture
5.2. HornetQ embedded in your own application
5.3. HornetQ integrated with a JEE application server
5.4. HornetQ stand-alone server
6. Using the Server
6.1. Starting and Stopping the standalone server
6.2. Server JVM settings
6.3. Server classpath
6.4. Library Path
6.5. System properties
6.6. Configuration files
6.7. JBoss Microcontainer Beans File
6.8. JBoss AS4 MBean Service.
6.9. The main configuration file.
7. Using JMS
7.1. A simple ordering system
7.2. JMS Server Configuration
7.3. JNDI configuration
7.4. The code
7.5. Directly instantiating JMS Resources without using JNDI
7.6. Setting The Client ID
7.7. Setting The Batch Size for DUPS_OK
7.8. Setting The Transaction Batch Size
8. Using Core
8.1. Core Messaging Concepts
8.1.1. Message
8.1.2. Address
8.1.3. Queue
8.1.4. ClientSessionFactory
8.1.5. ClientSession
8.1.6. ClientConsumer
8.1.7. ClientProducer
8.2. A simple example of using Core
9. Mapping JMS Concepts to the Core API
10. The Client Classpath
10.1. HornetQ Core Client
10.2. JMS Client
10.3. JMS Client with JNDI
11. Examples
11.1. JMS Examples
11.1.1. Application-Layer Failover
11.1.2. Core Bridge Example
11.1.3. Browser
11.1.4. Client Kickoff
11.1.5. Client-Side Load-Balancing
11.1.6. Clustered Grouping
11.1.7. Clustered Queue
11.1.8. Clustered Standalone
11.1.9. Clustered Topic
11.1.10. Message Consumer Rate Limiting
11.1.11. Dead Letter
11.1.12. Delayed Redelivery
11.1.13. Divert
11.1.14. Durable Subscription
11.1.15. Embedded
11.1.16. HTTP Transport
11.1.17. Instantiate JMS Objects Directly
11.1.18. Interceptor
11.1.19. JAAS
11.1.20. JMS Bridge
11.1.21. JMX Management
11.1.22. Large Message
11.1.23. Last-Value Queue
11.1.24. Load Balanced Clustered Queue
11.1.25. Management
11.1.26. Management Notification
11.1.27. Message Counter
11.1.28. Message Expiration
11.1.29. Message Group
11.1.30. Message Group
11.1.31. Message Priority
11.1.32. No Consumer Buffering
11.1.33. Non-Transaction Failover With Server Data Replication
11.1.34. Paging
11.1.35. Pre-Acknowledge
11.1.36. Message Producer Rate Limiting
11.1.37. Queue
11.1.38. Message Redistribution
11.1.39. Queue Requestor
11.1.40. Queue with Message Selector
11.1.41. Reattach Node example
11.1.42. Request-Reply example
11.1.43. Scheduled Message
11.1.44. Security
11.1.45. Send Acknowledgements
11.1.46. SSL Transport
11.1.47. Static Message Selector
11.1.48. Static Message Selector Using JMS
11.1.49. Stomp
11.1.50. Stomp Over Web Sockets
11.1.51. Symmetric Cluster
11.1.52. Temporary Queue
11.1.53. Topic
11.1.54. Topic Hierarchy
11.1.55. Topic Selector 1
11.1.56. Topic Selector 2
11.1.57. Transaction Failover With Data Replication
11.1.58. Transactional Session
11.1.59. XA Heuristic
11.1.60. XA Receive
11.1.61. XA Send
11.1.62. XA with Transaction Manager
11.2. Core API Examples
11.2.1. Embedded
11.3. Java EE Examples
11.3.1. EJB/JMS Transaction
11.3.2. HAJNDI (High Availability)
11.3.3. Resource Adapter Configuration
11.3.4. Resource Adapter Remote Server Configuration
11.3.5. JMS Bridge
11.3.6. MDB (Message Driven Bean)
11.3.7. Servlet Transport
11.3.8. Servlet SSL Transport
11.3.9. XA Recovery
12. Routing Messages With Wild Cards
13. Understanding the HornetQ Wildcard Syntax
14. Filter Expressions
15. Persistence
15.1. Configuring the bindings journal
15.2. Configuring the jms journal
15.3. Configuring the message journal
15.4. An important note on disabling disk write cache.
15.5. Installing AIO
15.6. Configuring HornetQ for Zero Persistence
16. Configuring the Transport
16.1. Understanding Acceptors
16.2. Understanding Connectors
16.3. Configuring the transport directly from the client side.
16.4. Configuring the Netty transport
16.4.1. Configuring Netty TCP
16.4.2. Configuring Netty SSL
16.4.3. Configuring Netty HTTP
16.4.4. Configuring Netty Servlet
17. Detecting Dead Connections
17.1. Cleaning up Dead Connection Resources on the Server
17.1.1. Closing core sessions or JMS connections that you have failed to close
17.2. Detecting failure from the client side.
17.3. Configuring Asynchronous Connection Execution
18. Resource Manager Configuration
19. Flow Control
19.1. Consumer Flow Control
19.1.1. Window-Based Flow Control
19.1.1.1. Using Core API
19.1.1.2. Using JMS
19.1.2. Rate limited flow control
19.1.2.1. Using Core API
19.1.2.2. Using JMS
19.2. Producer flow control
19.2.1. Window based flow control
19.2.1.1. Using Core API
19.2.1.2. Using JMS
19.2.1.3. Blocking producer window based flow control
19.2.2. Rate limited flow control
19.2.2.1. Using Core API
19.2.2.2. Using JMS
20. Guarantees of sends and commits
20.1. Guarantees of Transaction Completion
20.2. Guarantees of Non Transactional Message Sends
20.3. Guarantees of Non Transactional Acknowledgements
20.4. Asynchronous Send Acknowledgements
20.4.1. Asynchronous Send Acknowledgements
21. Message Redelivery and Undelivered Messages
21.1. Delayed Redelivery
21.1.1. Configuring Delayed Redelivery
21.1.2. Example
21.2. Dead Letter Addresses
21.2.1. Configuring Dead Letter Addresses
21.2.2. Dead Letter Properties
21.2.3. Example
21.3. Delivery Count Persistence
22. Message Expiry
22.1. Message Expiry
22.2. Configuring Expiry Addresses
22.3. Configuring The Expiry Reaper Thread
22.4. Example
23. Large Messages
23.1. Configuring the server
23.2. Setting the limits
23.2.1. Using Core API
23.2.2. Using JMS
23.3. Streaming large messages
23.3.1. Streaming over Core API
23.3.2. Streaming over JMS
23.4. Streaming Alternative
23.5. Cache Large Messages on client
23.6. Large message example
24. Paging
24.1. Page Files
24.2. Configuration
24.3. Paging Mode
24.3.1. Configuration
24.4. Dropping messages
24.5. Blocking producers
24.6. Caution with Addresses with Multiple Queues
24.7. Paging and message selectors
24.8. Paging and browsers
24.9. Paging and unacknowledged messages
24.10. Example
25. Queue Attributes
25.1. Predefined Queues
25.2. Using the API
25.3. Configuring Queues Via Address Settings
26. Scheduled Messages
26.1. Scheduled Delivery Property
26.2. Example
27. Last-Value Queues
27.1. Configuring Last-Value Queues
27.2. Using Last-Value Property
27.3. Example
28. Message Grouping
28.1. Using Core API
28.2. Using JMS
28.3. Example
28.4. Example
28.5. Clustered Grouping
28.5.1. Clustered Grouping Best Practices
28.5.2. Clustered Grouping Example
29. Pre-Acknowledge Mode
29.1. Using PRE_ACKNOWLEDGE
29.2. Example
30. Management
30.1. The Management API
30.1.1. Core Management API
30.1.1.1. Core Server Management
30.1.1.2. Core Address Management
30.1.1.3. Core Queue Management
30.1.1.4. Other Core Resources Management
30.1.2. JMS Management API
30.1.2.1. JMS Server Management
30.1.2.2. JMS ConnectionFactory Management
30.1.2.3. JMS Queue Management
30.1.2.4. JMS Topic Management
30.2. Using Management Via JMX
30.2.1. Configuring JMX
30.2.1.1. MBeanServer configuration
30.2.2. Example
30.3. Using Management Via Core API
30.3.1. Configuring Core Management
30.4. Using Management Via JMS
30.4.1. Configuring JMS Management
30.4.2. Example
30.5. Management Notifications
30.5.1. JMX Notifications
30.5.2. Core Messages Notifications
30.5.2.1. Configuring The Core Management Notification Address
30.5.3. JMS Messages Notifications
30.5.4. Example
30.6. Message Counters
30.6.1. Configuring Message Counters
30.6.2. Example
30.7. Administering HornetQ Resources Using The JBoss AS Admin Console
30.7.1. JMS Queues
30.7.2. JMS Topics
30.7.3. JMS Connection Factories
31. Security
31.1. Role based security for addresses
31.2. Secure Sockets Layer (SSL) Transport
31.3. Basic user credentials
31.4. Changing the security manager
31.5. JAAS Security Manager
31.5.1. Example
31.6. JBoss AS Security Manager
31.6.1. Configuring Client Login
31.7. Changing the username/password for clustering
32. Application Server Integration and Java EE
32.1. Configuring Message-Driven Beans
32.1.1. Using Container-Managed Transactions
32.1.2. Using Bean-Managed Transactions
32.1.3. Using Message Selectors with Message-Driven Beans
32.2. Sending Messages from within JEE components
32.3. MDB and Consumer pool size
32.4. Configuring the JCA Adaptor
32.4.1. Global Properties
32.4.2. Adapter Outbound Configuration
32.4.3. Adapter Inbound Configuration
32.4.4. Configuring the adapter to use a standalone HornetQ Server
32.5. High Availability JNDI (HA-JNDI)
32.6. XA Recovery
32.6.1. XA Recovery Configuration
32.6.1.1. Configuration Settings
32.6.2. Example
33. The JMS Bridge
33.1. JMS Bridge Parameters
33.2. Source and Target Connection Factories
33.3. Source and Target Destination Factories
33.4. Quality Of Service
33.4.1. AT_MOST_ONCE
33.4.2. DUPLICATES_OK
33.4.3. ONCE_AND_ONLY_ONCE
33.4.4. Examples
34. Client Reconnection and Session Reattachment
34.1. 100% Transparent session re-attachment
34.2. Session reconnection
34.3. Configuring reconnection/reattachment attributes
34.4. ExceptionListeners and SessionFailureListeners
35. Diverting and Splitting Message Flows
35.1. Exclusive Divert
35.2. Non-exclusive Divert
36. Core Bridges
36.1. Configuring Bridges
37. Duplicate Message Detection
37.1. Using Duplicate Detection for Message Sending
37.2. Configuring the Duplicate ID Cache
37.3. Duplicate Detection and Bridges
37.4. Duplicate Detection and Cluster Connections
37.5. Duplicate Detection and Paging
38. Clusters
38.1. Clusters Overview
38.2. Server discovery
38.2.1. Broadcast Groups
38.2.2. Discovery Groups
38.2.3. Defining Discovery Groups on the Server
38.2.4. Discovery Groups on the Client Side
38.2.4.1. Configuring client discovery using JMS
38.2.4.2. Configuring client discovery using Core
38.3. Server-Side Message Load Balancing
38.3.1. Configuring Cluster Connections
38.3.2. Cluster User Credentials
38.4. Client-Side Load balancing
38.5. Specifying Members of a Cluster Explicitly
38.5.1. Specify List of Servers on the Client Side
38.5.1.1. Specifying List of Servers using JMS
38.5.1.2. Specifying List of Servers using the Core API
38.5.2. Specifying List of Servers to form a Cluster
38.6. Message Redistribution
38.7. Cluster topologies
38.7.1. Symmetric cluster
38.7.2. Chain cluster
39. High Availability and Failover
39.1. Live - Backup Pairs
39.1.1. HA modes
39.1.1.1. Data Replication
39.1.1.1.1. Configuration
39.1.1.1.2. Synchronizing a Backup Node to a Live Node
39.1.1.2. Shared Store
39.1.1.2.1. Configuration
39.1.1.2.2. Synchronizing a Backup Node to a Live Node
39.2. Failover Modes
39.2.1. Automatic Client Failover
39.2.1.1. A Note on Server Replication
39.2.1.2. Handling Blocking Calls During Failover
39.2.1.3. Handling Failover With Transactions
39.2.1.4. Handling Failover With Non Transactional Sessions
39.2.2. Getting Notified of Connection Failure
39.2.3. Application-Level Failover
40. Libaio Native Libraries
40.1. Compiling the native libraries
40.1.1. Install requirements
40.1.2. Invoking the compilation
41. Thread management
41.1. Server-Side Thread Management
41.1.1. Server Scheduled Thread Pool
41.1.2. General Purpose Server Thread Pool
41.1.3. Expiry Reaper Thread
41.1.4. Asynchronous IO
41.2. Client-Side Thread Management
42. Logging
42.1. Logging With The JBoss Application Server
43. Embedding HornetQ
43.1. POJO instantiation
43.2. Dependency Frameworks
43.3. Connecting to the Embedded HornetQ
43.3.1. Core API
43.3.2. JMS API
43.4. JMS Embedding Example
44. Intercepting Operations
44.1. Implementing The Interceptors
44.2. Configuring The Interceptors
44.3. Interceptors on the Client Side
44.4. Example
45. Interoperability
45.1. Stomp
45.1.1. Native Stomp support
45.1.1.1. Limitations
45.1.2. Mapping Stomp destinations to HornetQ addresses and queues
45.1.3. Stomp and JMS interoperabilty
45.1.3.1. Using JMS destinations
45.1.3.2. Send and consuming Stomp message from JMS or HornetQ Core API
45.1.4. Stomp Over Web Sockets
45.1.5. StompConnect
45.2. REST
45.3. AMQP
46. Performance Tuning
46.1. Tuning persistence
46.2. Tuning JMS
46.3. Other Tunings
46.4. Tuning Transport Settings
46.5. Tuning the VM
46.6. Avoiding Anti-Patterns
47. Configuration Reference
47.1. Server Configuration
47.1.1. hornetq-configuration.xml
47.1.2. hornetq-jms.xml