Results 1 to 7 of 7

Thread: messageBus Dispatcher-pool-size

  1. #1
    Join Date
    Jul 2008
    Location
    San Jose
    Posts
    22

    Default messageBus Dispatcher-pool-size

    The http://www.springframework.org/schem...ration-1.0.xsd does not have dispatcher pool size define. In the spring integration doc, it said the dispatcher pool size can be configured. Did this get removed?

    <message-bus dispatcher-pool-size="25"/>


    This is how I increase my dispatcher pool size right now if you are curious.

    <message-bus task-scheduler="providerTaskScheduler" />

    <beans:bean id="providerTaskScheduler" class="org.springframework.integration.scheduling. spi.ProviderTaskScheduler">
    <beans:constructor-arg index="0" ref="simpleScheduleServiceProvider" />
    </beans:bean>

    <beans:bean id="simpleScheduleServiceProvider" class="org.springframework.integration.scheduling. spi.SimpleScheduleServiceProvider">
    <beans:constructor-arg index="0" ref="scheduledThreadPoolExecutor" />
    </beans:bean>

    <beans:bean id="scheduledThreadPoolExecutor" class="java.util.concurrent.ScheduledThreadPoolExe cutor">
    <beans:constructor-arg index="0" value="40" />
    </beans:bean>'

    Thanks,

    Michael

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    The pool size property was removed, meaning that the configuration of the <message-bus/> element's 'task-scheduler' attribute is now more explicit - but also more flexible - and hopefully less confusing. If none is provided, the default is created by the parser instead of within the MessageBus implementation.

    The SimpleTaskScheduler (which still delegates to a TaskExecutor instance) replaces the scheduler classes that you were configuring, so that overall the configuration is actually simplified:
    Code:
    SimpleTaskScheduler taskScheduler = new SimpleTaskScheduler(anyTaskExecutor);
    If you define such a bean definition then provide it to the message bus:
    Code:
    <message-bus task-scheduler="simpleScheduler"/>
    You may also be interested in the namespace support for creating a ThreadPoolTaskExecutor:
    Code:
    <thread-pool-task-executor id="taskExecutor" core-size="5" max-size="50"/>
    Hope that helps.
    -Mark

  3. #3
    Join Date
    Jul 2008
    Location
    San Jose
    Posts
    22

    Default

    Thanks Mark. Can you provide some simple example on how to increase the core size? My example doesn't seem right.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    Can you post the relevant excerpt from your configuration and/or code?

  5. #5
    Join Date
    Jul 2008
    Location
    San Jose
    Posts
    22

    Default

    This is how i configured the dispatcher size right now. I didn't want to use ThreadPoolTaskExecutor because I would like to keep the Polling feature for schedule task.

    Code:
    <message-bus task-scheduler="providerTaskScheduler" />
    
    <beans:bean id="providerTaskScheduler" class="org.springframework.integration.scheduling. spi.ProviderTaskScheduler">
    <beans:constructor-arg index="0" ref="simpleScheduleServiceProvider" />
    </beans:bean>
    
    <beans:bean id="simpleScheduleServiceProvider" class="org.springframework.integration.scheduling. spi.SimpleScheduleServiceProvider">
    <beans:constructor-arg index="0" ref="scheduledThreadPoolExecutor" />
    </beans:bean>
    
    <beans:bean id="scheduledThreadPoolExecutor" class="java.util.concurrent.ScheduledThreadPoolExecutor">
    <beans:constructor-arg index="0" value="40" /> 
    </beans:bean>'

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    So, it looks like you are passing a core size of 40 to the constructor of ScheduledThreadPoolExecutor. Can you explain what you mean when you say that it's not working? What behavior are you observing?

  7. #7
    Join Date
    Jul 2008
    Location
    San Jose
    Posts
    22

    Default

    It is working. I am just wondering if that is the right way to do it or if there is a better way to configure this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •