Announcement Announcement Module
Collapse
No announcement yet.
messageBus Dispatcher-pool-size Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment


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

        Comment


        • #5
          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>'

          Comment


          • #6
            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?

            Comment


            • #7
              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.

              Comment

              Working...
              X