0

我正在阅读一条消息,对其进行转换并在 JMS 通道上输出。JMS 通道使用 WorkManager 任务执行器来读取消息并对其进行处理。即使我们将应用服务器中的 WorkManager 配置为有 10 个线程,但只使用了一个线程。

<si:chain id="prenotifchain" input-channel="preNotificationChannel"  output-channel="notificationJMSChannel">           
    <si:transformer id="prenotif"  method="transformRequest"  ref="notificationTransformer"/>   
</si:chain> 



<si-jms:channel id="notificationJMSChannel" queue="notificationQueue" connection-factory="queueConnectionFactory" transaction-manager="txManager" task-executor="notificationTaskExecutor"  />

<jee:jndi-lookup id="notificationQueue" jndi-name="jms/notifqueue"/>    


    <bean id="notificationTaskExecutor"
    class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    <property name="workManagerName" value="notifWM" />
    <property name="resourceRef" value="true" />
</bean>

我们是否缺少任何配置,或者是否有其他方法可以读取多个?

4

1 回答 1

0

请使用concurrency属性:

<xsd:attribute name="concurrency" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation><![CDATA[
The number of concurrent sessions/consumers to start for each listener.
Can either be a simple number indicating the maximum number (e.g. "5")
or a range indicating the lower as well as the upper limit (e.g. "3-5").
Note that a specified minimum is just a hint and might be ignored at runtime.
Default is 1; keep concurrency limited to 1 in case of a topic listener
or if message ordering is important; consider raising it for general queues.
            ]]></xsd:documentation>
        </xsd:annotation>
    </xsd:attribute>
于 2018-09-22T20:25:20.490 回答