I have the following bean
<bean id="executor"
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="1" />
<property name="maxPoolSize" value="1" />
<!-- Positive value leads to LinkedBlockingQueue,
any other value leads to SynchronousQueue -->
<property name="queueCapacity" value="0" />
</bean>
Oracle SynchronousQueue文档中提到:
此类支持可选的公平策略,以对等待生产者和消费者线程进行排序。默认情况下,不保证此排序。但是,使用fairness设置为true构建的队列按FIFO顺序授予线程访问权限。
我的问题是:如何在我的bean配置中指定我想要有顺序公平性?
谢谢!