Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10168

Unable to set global-client-thread-pool-max-size without setting global-client-scheduled-thread-pool-max-size and vice versa

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 15.0.0.Final
    • 14.0.0.Final
    • JMS
    • None

    Description

      Logic in messaging integration doesn't allow configuring property global-client-thread-pool-max-size without setting global-client-scheduled-thread-pool-max-size and vice versa [1].

      if (threadPoolMaxSize.isDefined()) {
           threadPoolMaxSizeValue = GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
      } else if (sysprops.containsKey(THREAD_POOL_MAX_SIZE_PROPERTY_KEY)) {
          threadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(THREAD_POOL_MAX_SIZE_PROPERTY_KEY));
      } else {
           // property is not configured using sysprop or explicit attribute
           threadPoolMaxSizeValue = null;
      }
      
      if (scheduledThreadPoolMaxSize.isDefined()) {
           scheduledThreadPoolMaxSizeValue = GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
      } else if (sysprops.containsKey(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY)) {
           scheduledThreadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY));
      } else {
         // property is not configured using sysprop or explicit attribute
          scheduledThreadPoolMaxSizeValue = null;
      }
      
      if (threadPoolMaxSizeValue != null && scheduledThreadPoolMaxSizeValue != null) {
          MessagingLogger.ROOT_LOGGER.debugf("Setting global client thread pool size to: regular=%s, scheduled=%s", threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
          ActiveMQClient.setGlobalThreadPoolProperties(threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
      }
      

      If either of these properties is not defined, thread pool sizes are not set on ActiveMQClient. User may want to set only one of these properties.

      It seems that Artemis doesn't have API allowing configuration of single property.

      Example:

      1. set global client thead pool max size using CLI - /subsystem=messaging-activemq:write-attribute(name=global-client-thread-pool-max-size,value=300)
      2. as the condition 'threadPoolMaxSizeValue != null && scheduledThreadPoolMaxSizeValue != null' is not satisfied (the other propery is undefined / null), set value 300 is not correctly configured on activemq.

      https://github.com/wildfly/wildfly/blob/6c0a002da2558fd4e4f72ceb034a0633c7b1dafd/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingSubsystemAdd.java#L114

      Attachments

        Activity

          People

            ehugonne1@redhat.com Emmanuel Hugonnet
            mstyk_jira Martin Styk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: