Rodi
Rodi

Reputation:

Configuring an MDB in JBOSS

How maxMessages property affects the MDB? For example:

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

How would this value affect if maxSessions is 10?

Upvotes: 0

Views: 4679

Answers (3)

Dave
Dave

Reputation: 14198

In the xml confi file standardjboss.xml you'd set MaximumSize to set the number of concurrent messages. In this case I've set it to 150. This affects all MDBs, however.

 <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>

Upvotes: 1

victor hugo
victor hugo

Reputation: 35848

I think you're confused, maxSessions refer to the the maximum number of JMS sessions that can concurrently deliver messages to MDB.

Upvotes: 2

skaffman
skaffman

Reputation: 403591

The JBoss docs are a bit wooly on this, they say MaxMessages is defined as

The number of messages to wait for before attempting delivery of the session, each message is still delivered in a separate transaction (default 1)

I think you were wondering if it affects the number of threads or concurrent sessions than can pass through the MDB at one time, but it seems this parameter is not related to that behaviour, and so there's no conflict.

Upvotes: 2

Related Questions