Concurrency MDB并发实例未启动
我有一个要求,我需要40个线程来完成某项任务(合并),大约20个线程来完成另一项任务(持久化)。合并所需的时间大约是持久性的5倍。 我正在使用消息驱动bean来实现这种并发性 我用以下配置创建了一个MDB记录合并Concurrency MDB并发实例未启动,concurrency,activemq,apache-tomee,message-driven-bean,tomee-7,Concurrency,Activemq,Apache Tomee,Message Driven Bean,Tomee 7,我有一个要求,我需要40个线程来完成某项任务(合并),大约20个线程来完成另一项任务(持久化)。合并所需的时间大约是持久性的5倍。 我正在使用消息驱动bean来实现这种并发性 我用以下配置创建了一个MDB记录合并 @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @A
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "testing/RecordMerger"),
@ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "40")
})
为了坚持,我也做了类似的事情
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "testing/RecordPersistor"),
@ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "20")
})
我在tomee.xml中的配置如下
<Container id="MyJmsMdbContainer" ctype="MESSAGE">
ResourceAdapter = MyJmsResourceAdapter
InstanceLimit = 40
</Container>
ResourceAdapter=MyJmsResourceAdapter
InstanceLimit=40
记录合并队列的生产速度非常快,因此记录合并队列中总是有新元素。记录合并队列将数据放入记录持久性队列
我面临的问题是,当记录合并被配置为使用40个线程时,我的tomee服务器不会实例化记录持久性MDB,这会导致记录堆积在该队列中。如果我将record Merge的maxSession属性减少到20,那么MDB和MDB都将开始实例化
请任何人指导我需要做什么,以确保MDB都在运行并且record Merge有40个线程。您可能还需要在资源适配器定义(tomee.xml)中设置threadPoolSize=40(默认为30)