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
Post a Comment