diff --git a/src/components/classic/documentation/async-sends.md b/src/components/classic/documentation/async-sends.md index 9ab22fe5df..adad24db71 100644 --- a/src/components/classic/documentation/async-sends.md +++ b/src/components/classic/documentation/async-sends.md @@ -42,9 +42,37 @@ You can enable this feature on the [ActiveMQConnection](http://incubator.apache. ((ActiveMQConnection)connection).setUseAsyncSend(true); ``` +### JMS 2.0 CompletionListener (since 6.2.0) + +JMS 2.0 introduced a standard API for asynchronous sending via `CompletionListener`. +When you call `send(message, completionListener)`, the provider notifies your `CompletionListener` once the send completes (or fails). + +```java +producer.send(message, new CompletionListener() { + @Override + public void onCompletion(Message message) { + // message was sent successfully + } + + @Override + public void onException(Message message, Exception exception) { + // send failed + } +}); +``` + +**Implementation note:** the current ActiveMQ Classic implementation performs the send synchronously and then invokes the `CompletionListener` callback on a separate thread. +This is explicitly permitted by the JMS 2.0 specification (section 7.3). +Application code that follows the specification will remain compatible if a future version implements fully asynchronous sending. + +For high-throughput asynchronous sending outside the JMS specification, the ActiveMQ-specific `useAsyncSend` flag described above remains available and provides true non-blocking behaviour. + +See also the [JMS 2.0 implementation status](jms2) page for the full list of supported features. + ### Also see * [Connection Configuration URI](connection-configuration-uri) * [Should I use transactions](should-i-use-transactions) * [Consumer Dispatch Async](consumer-dispatch-async) +* [JMS 2.0 Support](jms2) diff --git a/src/components/classic/documentation/jms2.md b/src/components/classic/documentation/jms2.md index 9b1f1b3a37..d8264d6895 100644 --- a/src/components/classic/documentation/jms2.md +++ b/src/components/classic/documentation/jms2.md @@ -63,18 +63,18 @@ The implementation approach is subject to change. Be sure to verify features in User feedback is welcome! Please comment on the JIRAs with questions and comments. -JIRA|Status|Target Version|Completed Version|Feature|Notes ----|:---:|---|---|---|--- -[AMQ-7309](https://issues.apache.org/jira/browse/AMQ-7309) | ✅ | 5.16.0 | 5.18.0 | JMS 2.0 API dependency | ActiveMQ will ship with a JMS 2.0 dependency jar -[AMQ-8322](https://issues.apache.org/jira/browse/AMQ-8322) | ✅ | 5.17.0 | 5.18.0 | `JMSContext`, `JMSConsumer`, `JMSProducer`, & `JMSRuntimeException` | Simplified JMS API support -[AMQ-8321](https://issues.apache.org/jira/browse/AMQ-8321) | ✅ | 5.18.0 | 5.18.0 | GetBody/isBodyAssignable | Support for checking body type using a `Class` -[AMQ-8325](https://issues.apache.org/jira/browse/AMQ-8325) | ✅ | 5.18.3, 6.0.0 | 5.18.3, 6.0.0 | XA Connection methods | Updated methods when using XA transactions -[AMQ-8494](https://issues.apache.org/jira/browse/AMQ-8494) | ✅ | 5.17.1 | 5.18.0 | Implement `CLIENT_ACKNOWLEDGEMENT` mode | Client ack requires special handling w/ the simplified JMSContext API -[AMQ-8464](https://issues.apache.org/jira/browse/AMQ-8464) | ❌ | 6.4.0 | | JMSConsumer | `.receiveBody(Class)` methods -[AMQ-8320](https://issues.apache.org/jira/browse/AMQ-8320) | ❌ | 6.3.0 | | Delivery Delay | Support for Message DeliveryDelay feature -[AMQ-8324](https://issues.apache.org/jira/browse/AMQ-8324) | ❌ | 6.4.0 | | JMSProducer features | `CompletionListener` async send support -[AMQ-8323](https://issues.apache.org/jira/browse/AMQ-8323) | ❌ | | | Shared Topic Consumer | Multi-consumer (queue-like) consuming from topic subscriptions -[AMQ-9451](https://issues.apache.org/jira/browse/AMQ-9451) | ❌ | 6.5.0 | | Pooled `ConnectionFactory` | Support for JMSContext in activemq-jms-pool +JIRA|Status|Target Version| Completed Version |Feature|Notes +---|:---:|---|-------------------|---|--- +[AMQ-7309](https://issues.apache.org/jira/browse/AMQ-7309) | ✅ | 5.16.0 | 5.18.0 | JMS 2.0 API dependency | ActiveMQ will ship with a JMS 2.0 dependency jar +[AMQ-8322](https://issues.apache.org/jira/browse/AMQ-8322) | ✅ | 5.17.0 | 5.18.0 | `JMSContext`, `JMSConsumer`, `JMSProducer`, & `JMSRuntimeException` | Simplified JMS API support +[AMQ-8321](https://issues.apache.org/jira/browse/AMQ-8321) | ✅ | 5.18.0 | 5.18.0 | GetBody/isBodyAssignable | Support for checking body type using a `Class` +[AMQ-8325](https://issues.apache.org/jira/browse/AMQ-8325) | ✅ | 5.18.3, 6.0.0 | 5.18.3, 6.0.0 | XA Connection methods | Updated methods when using XA transactions +[AMQ-8494](https://issues.apache.org/jira/browse/AMQ-8494) | ✅ | 5.17.1 | 5.18.0 | Implement `CLIENT_ACKNOWLEDGEMENT` mode | Client ack requires special handling w/ the simplified JMSContext API +[AMQ-8464](https://issues.apache.org/jira/browse/AMQ-8464) | ❌ | 6.4.0 | | JMSConsumer | `.receiveBody(Class)` methods +[AMQ-8320](https://issues.apache.org/jira/browse/AMQ-8320) | ❌ | 6.3.0 | | Delivery Delay | Support for Message DeliveryDelay feature +[AMQ-8324](https://issues.apache.org/jira/browse/AMQ-8324) | ✅ | 6.4.0 | 6.3.0 | JMSProducer features | `CompletionListener` async send support. Note: the current implementation performs the send synchronously and invokes the `CompletionListener` on a separate thread, which is permitted by the JMS 2.0 specification (section 7.3). +[AMQ-8323](https://issues.apache.org/jira/browse/AMQ-8323) | ❌ | | | Shared Topic Consumer | Multi-consumer (queue-like) consuming from topic subscriptions +[AMQ-9451](https://issues.apache.org/jira/browse/AMQ-9451) | ❌ | 6.5.0 | | Pooled `ConnectionFactory` | Support for JMSContext in activemq-jms-pool ### Feature notes