[jboss-jira] [JBoss JIRA] (WFLY-10168) Unable to set global-client-thread-pool-max-size without setting global-client-scheduled-thread-pool-max-size and vice versa

Martin Styk (JIRA) issues at jboss.org
Tue Sep 11 09:13:00 EDT 2018


     [ https://issues.jboss.org/browse/WFLY-10168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Styk updated WFLY-10168:
-------------------------------
    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].
{code}
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);
}
{code}

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:
# set global client thead pool max size using CLI - /subsystem=messaging-activemq:write-attribute(name=global-client-thread-pool-max-size,value=300)
# 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

  was:
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]. It seems that Artemis doesn't have API allowing configuration of single property.

User may want to set only one of these properties.

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



> Unable to set global-client-thread-pool-max-size without setting global-client-scheduled-thread-pool-max-size and vice versa
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-10168
>                 URL: https://issues.jboss.org/browse/WFLY-10168
>             Project: WildFly
>          Issue Type: Bug
>          Components: JMS
>            Reporter: Martin Styk
>            Assignee: Jeff Mesnil
>
> 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].
> {code}
> 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);
> }
> {code}
> 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:
> # set global client thead pool max size using CLI - /subsystem=messaging-activemq:write-attribute(name=global-client-thread-pool-max-size,value=300)
> # 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



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list