简体   繁体   English

JMS活动mq一条消息将同时使用

[英]JMS active mq one message to be consumed concurrently

I am using apache active mq, and have a common consumer for multiple operations. 我正在使用apache active mq,并且有一个共同的使用者进行多种操作。 For every consumer it will take around 15-20 mins for code execution, and I want if in between the another message is produced then both messages should be consumed in parallel though both have one consumer only. 对于每个使用者,大约需要15-20分钟的时间来执行代码,我想如果在另一个消息之间产生,那么两个消息都应该并行使用,尽管它们都只有一个使用者。

In application context where you have defined the DefaultMessageListenerContainer bean, You can add "concurrentConsumers" property and define the number of concurrent consumers you want, to listen to your message Queue. 在定义了DefaultMessageListenerContainer bean的应用程序上下文中,可以添加“ concurrentConsumers”属性并定义所需的并发使用者数,以侦听消息Queue。

Below is an example for the same 以下是相同的示例

 <bean id="jmsMailContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="concurrentConsumers">
        <value>100</value>
    </property>
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="mailDestination"/>
    <property name="messageListener" ref="jmsMailConsumer"/>
</bean>  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM