You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/10/25 16:19:32 UTC

[GitHub] [activemq-artemis] brusdev commented on a change in pull request #3813: ARTEMIS-3539 allow a single connection for MDB's

brusdev commented on a change in pull request #3813:
URL: https://github.com/apache/activemq-artemis/pull/3813#discussion_r735761283



##########
File path: artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java
##########
@@ -306,12 +306,19 @@ protected synchronized void setup() throws Exception {
 
       Exception firstException = null;
 
+      ClientSessionFactory cf = null;
+
       for (int i = 0; i < spec.getMaxSession(); i++) {
-         ClientSessionFactory cf = null;
+         //if we are sharing the ceonnection only create 1
+         if (!spec.isSingleConnection()) {
+            cf = null;
+         }
          ClientSession session = null;
 
          try {
-            cf = factory.getServerLocator().createSessionFactory();
+            if (cf == null) {

Review comment:
       if spec.getMaxSession() > 1 and spec.isSingleConnection() == true and an exception is raised cf is closed and not created again:
   `
            } catch (Exception e) {
               if (cf != null) {
                  cf.close();
               }
   `




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org