1

I have an application that uses Spring Integration for Parallel calls. All configurations are in the config.xml. Is there a way to set the decorator of every task executor I placed but still using the XML configuration? I have to pass the MDC from the main thread to the parallel threads of my logger.

<task:executor id="taskExecutor" pool-size="650-700"
               queue-capacity="3000" rejection-policy="CALLER_RUNS"/>

This is the task executor config I have right now.

Mawie
  • 33
  • 4

1 Answers1

2

It can't be specified with <task:executor/> as it is not supported. Rather you can define a separate bean like this and configure your own task decorator

<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
    <property name="corePoolSize" value="4" />
    <property name="maxPoolSize" value="4" />
    <property name="WaitForTasksToCompleteOnShutdown" value="true" />
    <property name="taskDecorator" ref="taskDecorator" />
</bean>
Magesh
  • 427
  • 3
  • 12