java - spring async can not add "waitForTasksToCompleteOnShutdown" in <task:executor/> -


<task:executor id="activation-2000"            pool-size="#[activation_thread_number]"            queue-capacity="20000"            waitfortaskstocompleteonshutdown="true"/> 

in example above when add waitfortaskstocompleteonshutdown property. below error since xsd not support. why can not add waitfortaskstocompleteonshutdown in above naming.

attribute waitfortaskstocompleteonshutdown not allowed appear in element task:executor.

answer

using beanpostprocessor below implementation can fix problem

@override public object postprocessbeforeinitialization(object object, string arg1)         throws beansexception {     if(object instanceof threadpooltaskscheduler)         ((threadpooltaskscheduler)object).setwaitfortaskstocompleteonshutdown(true);     return object; } 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -