License
Contents
1. Introduction
1.1. Abstract
1.2. Overview
1.2.1. Is this a mail API?
1.2.2. Existing messaging systems
1.2.3. JMS objectives
1.2.3.1. JMS provider
1.2.3.2. JMS messages
1.2.3.3. JMS domains
1.2.3.4. Portability
1.2.4. What JMS does not include
1.3. What is required by JMS
1.4. Relationship to other Java APIs
1.4.1. Java DataBase Connectivity (JDBCTM) software
1.4.2. JavaBeansTM components
1.4.3. Enterprise JavaBeansTM component model
1.4.4. Java Transaction API (JTA)
1.4.5. Java Transaction Service (JTS)
1.4.6. Java Naming and Directory InterfaceTM (JNDI) API
1.4.7. Java Platform, Enterprise Edition (Java EE)
1.5. What is new in JMS 1.1?
1.6. What is new in JMS 2.0?
2. Architecture
2.1. Overview
2.2. What is a JMS application?
2.3. Administration
2.4. Two messaging styles
2.5. JMS interfaces
2.6. Developing a JMS application
2.6.1. Developing a JMS client
2.7. Security
2.8. Multi-threading
2.9. Triggering clients
2.10. Request/reply
3. JMS message model
3.1. Background
3.2. Goals
3.3. JMS messages
3.4. Message header fields
3.4.1. JMSDestination
3.4.2. JMSDeliveryMode
3.4.3. JMSMessageID
3.4.4. JMSTimestamp
3.4.5. JMSCorrelationID
3.4.6. JMSReplyTo
3.4.7. JMSRedelivered
3.4.8. JMSType
3.4.9. JMSExpiration
3.4.10. JMSPriority
3.4.11. How message header values are set
3.4.12. Overriding message header fields
3.4.13. JMSDeliveryTime
3.5. Message properties
3.5.1. Property names
3.5.2. Property values
3.5.3. Using properties
3.5.4. Property value conversion
3.5.5. Property values as objects
3.5.6. Property iteration
3.5.7. Clearing a message’s property values
3.5.8. Non-existent properties
3.5.9. JMS defined properties
3.5.10. Provider-specific properties
3.5.11. JMSXDeliveryCount
3.6. Message acknowledgment
3.7. The Message interface
3.8. Message selection
3.8.1. Message selector
3.8.1.1. Message selector syntax
3.8.1.2. Null values
3.8.1.3. Special notes
3.9. Access to sent messages
3.10. Changing the value of a received message
3.11. JMS message body
3.11.1. Clearing a message body
3.11.2. Read-only message body
3.11.3. Conversions provided by StreamMessage and MapMessage
3.11.4. Messages for non-JMS clients
3.12. Provider implementations of JMS message interfaces
4. JMS common facilities
4.1. Overview
4.2. Administered objects
4.2.1. Destination
4.2.2. ConnectionFactory
4.3. Connection
4.3.1. Authentication
4.3.2. Client identifier
4.3.3. Connection setup
4.3.4. Pausing delivery of incoming messages
4.3.5. Closing a Connection
4.3.6. Sessions
4.3.7. ConnectionMetaData
4.3.8. ExceptionListener
4.4. Session
4.4.1. Closing a Session
4.4.2. MessageProducer and MessageConsumer Creation
4.4.3. Creating temporary destinations
4.4.4. Creating Destination objects
4.4.5. Optimized message implementations
4.4.6. Conventions for using a session
4.4.7. Transactions
4.4.8. Distributed transactions
4.4.9. Multiple sessions
4.4.10. Message order
4.4.10.1. Order of message receipt
4.4.10.2. Order of message sends
4.4.11. Message acknowledgment
4.4.12. Duplicate delivery of messages
4.4.13. Duplicate production of messages
4.4.14. Serial execution of client code
4.4.15. Concurrent message delivery
4.5. MessageConsumer
4.5.1. Synchronous delivery
4.5.2. Asynchronous delivery
4.6. MessageProducer
4.7. Message delivery mode
4.8. Message time-to-live
4.9. Exceptions
4.10. Reliability
4.11. Method inheritance across messaging domains
4.12. Batch delivery
4.13. Delivery delay
5. JMS point-to-point model
5.1. Overview
5.2. Queue management
5.3. Queue
5.4. TemporaryQueue
5.5. QueueConnectionFactory
5.6. QueueConnection
5.7. QueueSession
5.8. QueueReceiver
5.9. QueueBrowser
5.10. QueueRequestor
5.11. Reliability
6. JMS publish/subscribe model
6.1. Overview
6.2. Pub/sub latency
6.3. Durable subscription
6.4. Topic management
6.5. Topic
6.6. TemporaryTopic
6.7. TopicConnectionFactory
6.8. TopicConnection
6.9. TopicSession
6.10. TopicPublisher
6.11. TopicSubscriber
6.11.1. Durable subscriptions
6.12. Recovery and redelivery
6.13. Administering subscriptions
6.14. TopicRequestor
6.15. Reliability
7. JMS exceptions
7.1. Overview
7.2. The JMSException
7.3. Standard exceptions
8. JMS application server facilities
8.1. Overview
8.2. Concurrent processing of a subscription’s messages
8.2.1. Session
8.2.2. ServerSession
8.2.3. ServerSessionPool
8.2.4. ConnectionConsumer
8.2.5. How a ConnectionConsumer uses a ServerSession
8.2.6. How an application server implements a ServerSession
8.2.7. The result
8.3. XAConnectionFactory
8.4. XAConnection
8.5. XASession
8.6. JMS application server interfaces
9. JMS example code
9.1. Preparing to send and receive messages
9.1.1. Getting a ConnectionFactory
9.1.2. Getting a Destination
9.1.3. Creating a Connection
9.1.4. Creating a Session
9.1.5. Creating a MessageProducer
9.1.6. Creating a MessageConsumer
9.1.7. Starting message delivery
9.1.8. Using a TextMessage
9.2. Sending and receiving messages
9.2.1. Sending a message
9.2.2. Receiving a message synchronously
9.2.3. Unpacking a TextMessage
9.3. Other messaging features
9.3.1. Receiving messages asynchronously
9.3.2. Using message selection
9.3.3. Using durable subscriptions
9.3.3.1. Creating a durable subscription
9.3.3.2. Reconnecting to a topic using a durable subscription
9.4. JMS message types
9.4.1. Creating a TextMessage
9.4.2. Unpacking a TextMessage
9.4.3. Creating a BytesMessage
9.4.4. Unpacking a BytesMessage
9.4.5. Creating a MapMessage
9.4.6. Unpacking a MapMessage
9.4.7. Creating a StreamMessage
9.4.8. Unpacking a StreamMessage
9.4.9. Creating an ObjectMessage
9.4.10. Unpacking an ObjectMessage
10. Use of JMS API in Java EE applications
10.1. Overview
10.2. Restrictions on the use of JMS API in the Java EE web or EJB container
10.3. Behaviour of JMS sessions in the Java EE web or EJB container
11. Simplified JMS API
11.1. Goals of the simplified API
11.2. Key features of the simplified API
11.2.1. MessagingContext
11.2.1. Static constants for session mode
11.2.2. Creating messages
11.2.3. Sending messages
11.2.4. Consuming messages asynchronously
11.2.5. Consuming messages synchronously
11.2.6. Closing the MessagingContext
11.2.7. Automatic start of message delivery
11.2.8. Threading restrictions on a MessagingContext
11.2.9. Exceptions
11.3. Injection of MessagingContext objects
11.4. Examples using the simplified API
11.4.1. Sending a message (Java EE)
11.4.1.1. Example using the standard API
11.4.1.2. Example using the simplified API
11.4.1.3. Example using the simplified API and injection
11.4.2. Sending a message (Java SE)
11.4.2.1. Example using the standard API
11.4.2.2. Example using the simplified API
11.4.3. Receiving a message synchronously (Java EE)
11.4.3.1. Example using the standard API
11.4.3.2. Example using the simplified API
11.4.3.3. Example using the simplified API and injection
11.4.4. Receiving a message synchronously (Java SE)
11.4.4.1. Example using the standard API
11.4.4.2. Example using the simplified API
11.4.5. Receiving a message synchronously from a durable subscription (Java EE)
11.4.5.1. Example using the standard API
11.4.5.2. Example using the simplified API
11.4.5.3. Example using the simplified API and injection
11.4.6. Receiving messages asynchronously (Java SE)
11.4.6.1. Example using the standard API
11.4.6.2. Example using the simplified API
11.4.7. Receiving a message asynchronously from a durable subscription (Java SE)
11.4.7.1. Example using the standard API
11.4.7.2. Example using the simplified API
11.4.8. Receiving a message in multiple threads (Java SE)
11.4.8.1. Example using the standard API
11.4.8.2. Example using the simplified API
11.4.9. Receiving synchronously and sending a message in the same local transaction (Java SE)
11.4.9.1. Example using the standard API
11.4.9.2. Example using the simplified API
11.4.10. Request/reply pattern using a TemporaryQueue (Java EE)
11.4.10.1. Example using the standard API
11.4.10.2. Example using the simplified API
11.4.10.3. Example using the simplified API and injection
A. Issues
A.1. Resolved issues
A.1.1 JDK 1.1.x compatibility
A.1.1 Distributed Java event model
A.1.2 Should the two JMS domains, PTP and pub/sub, be merged?
A.1.3 Should JMS specify a set of JMS JavaBeans?
A.1.4 Alignment with the CORBA notification service
A.1.5 Should JMS provide end-to-end synchronous message delivery and notification of delivery?
A.1.6 Should JMS provide a send-to-list mechanism?
A.1.7 Should JMS provide subscription notification?
A.2. Unresolved issues in the JMS 2.0 Early Draft
A.2.1 Simplified JMS API: Support for multiple consumers on a session
A.2.2 Simplified API: Injecting a MessagingContext
A.2.3 Batch message delivery
B. Change history
B.1. Version 1.0.1
B.1.1 JMS exceptions
B.2. Version 1.0.2
B.2.1 The multiple topic subscriber special case
B.2.2 Message selector comparison of exact and inexact numeric values
B.2.3 Connection and session close
B.2.4 Creating a session on an active connection
B.2.5 Delivery mode and message retention
B.2.6 The ‘single thread’ use of sessions
B.2.7 Clearing a message’s properties and body
B.2.8 Message selector numeric literal syntax
B.2.9 Comparison of boolean values in message selectors
B.2.10 Order of messages read from a queue
B.2.11 Null values in messages
B.2.12 Closing constituents of closed connections and sessions
B.2.13 The termination of a pending receive on close
B.2.14 Incorrect entry in Stream and Map Message conversion table
B.2.15 Inactive durable subscription
B.2.16 Read-only message body
B.2.17 Changing header fields of a received message
B.2.18 Null/missing message properties and message fields
B.2.19 JMS source errata
B.2.20 JMS source Java API documentation errata
B.2.21 JMS source Java API documentation clarifications
B.3. Version 1.0.2b
B.3.1 JMS API specification, version 1.0.2: errata and clarifications
B.3.2 JMS API Java API documentation, version 1.0.2a: major errata
B.3.2.1. Corrections of mistakes
B.3.2.2. Reconciliations between the specification and the Java API documentation
B.3.3 JMS API Java API documentation, version 1.0.2a: lesser errata
B.4. Version 1.1
B.4.1 Unification of messaging domains
B.4.2 JMS API specification, version 1.1: domain unification
B.4.3 JMS API specification, version 1.1: updates and clarifications
B.4.3.1. Updates to introduction, added figures
B.4.3.2. Clarifications
B.4.4 JMS API Java API documentation, version 1.1: domain unification
B.4.5 JMS API documentation, version 1.1: changes
B.4.5.1. New methods
B.4.5.2. Clarifications
B.5. Version 2.0
B.5.1 Re-ordering of chapters
B.5.2 JMS providers must implement both P2P and Pub-Sub (JMS_SPEC-50)
B.5.3 Use of JMS API in Java EE applications (JMS_SPEC-45 and JMS_SPEC-27)
B.5.4 New methods to create a session (JMS_SPEC-45)
B.5.5 Batch delivery (JMS_SPEC-36)
B.5.6 Delivery delay (JMS_SPEC-44)
B.5.7 Sending messages asynchronously (JMS_SPEC-43)
B.5.8 Use of AutoCloseable (JMS_SPEC-53)
B.5.9 JMSXDeliveryCount (JMS_SPEC-42)
B.5.10 Client ID optional on Durable subscriptions (JMS_SPEC-39)
B.5.11 New createDurableConsumer methods (JMS_SPEC-51)
B.5.12 Simplified API (JMS_SPEC-64)
B.5.13 Clarification: message may be sent using any session (JMS_SPEC-52)
B.5.14 Clarification: use of ExceptionListener (JMS_SPEC-49)
B.5.15 Clarification: use of stop or close from a message listener (JMS_SPEC-48)
B.5.16 Clarification: use of noLocal when creating a durable subscription (JMS_SPEC-65)
B.5.17 Clarification: message headers that are intended to be set by the JMS provder (JMS_SPEC-34)