1

We have the following configuration in standalone-full.xml of wildfly10.

 <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
            <session-bean>
                <stateless>
                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                </stateless>
                <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
                <singleton default-access-timeout="5000"/>
            </session-bean>
            <mdb>
                <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
                <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
            </mdb>
            <pools>
                <bean-instance-pools>
                    <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="ExchangeMessagePool" max-pool-size="10" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    </bean-instance-pools>
            </pools>
            </subsystem>

We have the following message driven bean which is linked with exchange message pool.In the standalone-full.xml we have set the max-pool-size as 10 but the number of instances getting created during the server startup is 30 but I don't know where it is coming from.Is there any way can we restrict this.If there is any way to restrict the number of concurrent threads accessing this bean in standalone-full file.

@MessageDriven(name = "ExchangeMessage", activationConfig = {@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/ExchangeMessageQueue")})
@PermitAll
@Pool("ExchangeMessagePool")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@TransactionManagement(TransactionManagementType.CONTAINER)
public class ExchangeMessageBean implements MessageListener
{
...
}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Possible duplicate of [How to configure Wildfly to serve static content (like images)?](http://stackoverflow.com/questions/22684037/how-to-configure-wildfly-to-serve-static-content-like-images) – James R. Perkins Jul 28 '16 at 18:30
  • Have you figured out how to do it? I am also trying it with similar scenario in [this thread](http://stackoverflow.com/q/40806160/3231778) – Evandro Pomatti Nov 29 '16 at 00:24

1 Answers1

0

If you don't specify the @ResourceAdapter it uses the default pooled-connection-factory named "activemq-ra" which has its own default and either uses its default (which i think is is 15) in addition to your specified pool, or both. You can annotate the MDB with maxSessions="n" and that would limit the number of parallel instances to n.

inor
  • 2,781
  • 2
  • 32
  • 42