0

maxMessages 属性如何影响 MDB?例如:

@ActivationConfigProperty(propertyName = "maxMessages", propertyValue="5"). 

如果 maxSessions 为 10,此值将如何影响?

4

3 回答 3

2

JBoss 文档对此有点模糊,他们说 MaxMessages 被定义为

在尝试传递会话之前等待的消息数,每条消息仍然在单独的事务中传递(默认为 1)

我想您想知道它是否会影响一次通过 MDB 的线程数或并发会话数,但似乎此参数与该行为无关,因此没有冲突。

于 2009-06-27T16:52:49.163 回答
2

我想你很困惑,maxSessions指的是可以同时向MDB传递消息的JMS会话的最大数量。

于 2009-06-27T16:56:46.757 回答
1

在 xml 配置文件 standardjboss.xml 中,您可以设置 MaximumSize 来设置并发消息的数量。在本例中,我将其设置为 150。但是,这会影响所有 MDB。

 <invoker-proxy-binding>
      <name>message-driven-bean</name>
      <invoker-mbean>default</invoker-mbean>
      <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
      <proxy-factory-config>
        <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
        <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
        <CreateJBossMQDestination>true</CreateJBossMQDestination>
        <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
        <MinimumSize>1</MinimumSize>
        **<MaximumSize>150</MaximumSize>**
        <KeepAliveMillis>30000</KeepAliveMillis>
        <MaxMessages>1</MaxMessages>
        <MDBConfig>
          <ReconnectIntervalSec>10</ReconnectIntervalSec>
          <DLQConfig>
            <DestinationQueue>queue/DLQ</DestinationQueue>
            <MaxTimesRedelivered>200</MaxTimesRedelivered>
            <TimeToLive>0</TimeToLive>
          </DLQConfig>
        </MDBConfig>
      </proxy-factory-config>
    </invoker-proxy-binding>
于 2009-08-19T15:19:27.647 回答