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 14:57:16 UTC

[GitHub] [activemq-artemis] andytaylor opened a new pull request #3813: ARTEMIS-3539 allow a single connection for MDB's

andytaylor opened a new pull request #3813:
URL: https://github.com/apache/activemq-artemis/pull/3813


   https://issues.apache.org/jira/browse/ARTEMIS-3539


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
brusdev merged pull request #3813:
URL: https://github.com/apache/activemq-artemis/pull/3813


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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