为JMS组件设置TaskExecutor

时间:2013-04-17 10:58:52

标签: java apache-camel

我想设置我的jms组件以使用特定的TaskExecutor(实际上宁愿使用ExecutorService但似乎不可能)。但是,为什么我尝试这样做,我得到一个错误。

我的春天有以下几点:

<bean id="jmsExecutorService" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor>....</bean>

我的Route Builder具有以下内容:

from("jms:queue:myQueue?concurrentConsumers=20&taskExecutor=jmsExecutorService")...

当我运行时,我收到以下错误:

IllegalArgumentException: Could not find a suitable setter for property: taskExecutor
     as there isn't a setter method with same type: String not a conversion possible:
     No type converter available to convert from type: String to the required type
     TaskExecutor with value jmsExecutorService

我很难找到设置TaskExecutor的工作示例。我想指定一个特定的TaskExecutor,因为我想适当地命名线程池中的线程。

1 个答案:

答案 0 :(得分:1)