You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/08/23 12:43:03 UTC

[activemq-artemis] branch main updated: ARTEMIS-3954: add more detail to core-client javadoc around the session and children thread model being like the JMS client

This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new f6bca09afa ARTEMIS-3954: add more detail to core-client javadoc around the session and children thread model being like the JMS client
f6bca09afa is described below

commit f6bca09afaca1fd1ae97ca520784945dbf63bdd5
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Tue Aug 23 13:30:15 2022 +0100

    ARTEMIS-3954: add more detail to core-client javadoc around the session and children thread model being like the JMS client
---
 .../apache/activemq/artemis/api/core/client/ClientConsumer.java    | 3 +++
 .../org/apache/activemq/artemis/api/core/client/ClientSession.java | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java
index 55985fed58..7db6180a93 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java
@@ -96,6 +96,9 @@ public interface ClientConsumer extends AutoCloseable {
    /**
     * Sets the MessageHandler for this consumer to consume messages asynchronously.
     * <p>
+    * Note that setting a handler dedicates the parent session, and its child producers
+    * and consumers, to the session-wide handler delivery thread of control.
+    * <p>
     * Calling this method on a closed consumer will throw a ActiveMQException.
     *
     * @param handler a MessageHandler
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
index 51df731bc6..1e748ebae9 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
@@ -28,7 +28,12 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.RoutingType;
 
 /**
- * A ClientSession is a single-thread object required for producing and consuming messages.
+ * A ClientSession is a single-threaded parent object required for producing and consuming messages.
+ * <p>
+ * Only a single thread may be used to operate on the session and its child producers and consumers,
+ * other than close() methods which may be called from another thread. Setting a MessageHandler on a
+ * consumer renders the session, and all its child producers and consumers, to be dedicated to the
+ * session-wide handler delivery thread of control.
  */
 public interface ClientSession extends XAResource, AutoCloseable {