You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "john lilley (Jira)" <ji...@apache.org> on 2022/12/06 11:41:00 UTC

[jira] [Commented] (ARTEMIS-4105) useGlobalPools=false or ActiveMQConnectionFactory.setUseGlobalPools(false) makes for dead services

    [ https://issues.apache.org/jira/browse/ARTEMIS-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17643842#comment-17643842 ] 

john lilley commented on ARTEMIS-4105:
--------------------------------------

We've resolved our threading issues with a single pool and this is not a blocker for our project any longer.  However, it does seem to be broken.

> useGlobalPools=false or ActiveMQConnectionFactory.setUseGlobalPools(false) makes for dead services
> --------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4105
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4105
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: ActiveMQ-Artemis-Native
>    Affects Versions: 2.27.1
>            Reporter: john lilley
>            Assignee: Clebert Suconic
>            Priority: Major
>         Attachments: amqtest.zip
>
>
> We have an application, which mostly interfaces with the vanilla JMS driver for Artemis, except for the connection factory.
> In an attempt to work around ARTEMIS-4104, I investigated using per-connection thread pools as per [https://activemq.apache.org/components/artemis/documentation/latest/thread-pooling.html], in the hope that I could divide services in categories, and have each category use an independent thread pool.  Instead, I find that the application is completely dead.  Nothing is ever delivered to services.
> Please tell me I'm just doing something stupid :)
> To validate, build the attached project using maven 3.8 and JDK 17.  Run the Main, and ... nothing will happen after the requests are posted to the queue.
> This is a very small change from the sample posted to ARTEMIS-4104, which runs (albeit with a deadlock issue) so I don't think anything is different other than the attempt to use multiple connections, each with its own thread pool.
> PS: if this method 
> {code:java}
> public static Connection getConnection(String label) {
>    return connections.computeIfAbsent(label, k -> {
>       try {
>          Connection connection = getConnectionFactory().createConnection("admin", "admin");
>          connection.start();
>          return connection;
>       } catch (Exception ex) {
>          throw new RuntimeException("Failed to make AMQ connection", ex);
>       }
>    });
> } {code}
> Is simply changed to
> {code:java}
> public static Connection getConnection(String label) {
>    return connections.computeIfAbsent("", k -> {
> ...
> } {code}
> So everything gets the same connection, it works.  It also works if I don't call 
> {{connectionFactory.setUseGlobalPools(false);}}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)