layout: default_md title: Activation Spec Properties title-class: page-title-activemq5 type: activemq5

Connectivity > Containers > Resource Adapter > Activation Spec Properties

An Activation Spec is used to configure the message delivery to an MDB. The ejb-jar.xml deployment descriptor needs to include a element inside the element like:

<activation-config>
    <activation-config-property>
       <activation-config-property-name>destination</activation-config-property-name>
       <activation-config-property-value>queue.testQueue</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
       <activation-config-property-name>destinationType</activation-config-property-name>
       <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
    </activation-config-property>
</activation-config>

Here, the value for destination is the physical name of the desired destination. The value for destinationType is the class name that defines the type of destination. It should be javax.jms.Queue or javax.jms.Topic.
  The Activation Spec properties that can be configured are:

Property NameRequiredDefault ValueDescription
acknowledgeModenoAuto-acknowledgeThe JMS Acknowledgement mode to use. Valid values are: Auto-acknowledge or Dups-ok-acknowledge
clientIdnoset in resource adapterThe JMS Client ID to use (only really required for durable topics)
destinationTypeyesnullThe type of destination; a queue or topic
destinationyesnullThe destination name (queue or topic name)
enableBatchnofalseUsed to enable transaction batching for increased performance
maxMessagesPerBatchno10The number of messages per transaction batch
maxMessagesPerSessionsno10This is actually the prefetch size for the subscription. (Yes, badly named).
maxSessionsno10The maximum number of concurrent sessions to use
messageSelectornonullThe JMS Message Selector to use on the subscription to perform content based routing filtering the messages
noLocalnofalseOnly required for topic subscriptions; indicates if locally published messages should be included in the subscription or not
passwordnoset in resource adapterThe password for the JMS connection
subscriptionDurabilitynoNonDurableWhether or not a durable (topic) subscription is required. Valid values are: Durable or NonDurable
subscriptionNamenonullThe name of the durable subscriber. Only used for durable topics and combined with the clientID to uniquely identify the durable topic subscription
userNamenoset in resource adapterThe user for the JMS connection
useRAManagedTransactionnofalseTypically, a resource adapter delivers messages to an endpoint which is managed by a container. Normally, this container likes to be the one that wants to control the transaction that the inbound message is being delivered on. But sometimes, you want to deliver to a simpler container system that will not be controlling the inbound transaction. In these cases, if you set useRAManagedTransaction to true, the resource adapter will commit the transaction if no exception was generated from the MessageListener and rollback if an exception is thrown.
initialRedeliveryDelayno1000The delay before redeliveries start. Also configurable on the ResourceAdapter
maximumRedeliveriesno5The maximum number of redeliveries or -1 for no maximum. Also configurable on the ResourceAdapter
redeliveryBackOffMultiplierno5The multiplier to use if exponential back off is enabled. Also configurable on the ResourceAdapter
redeliveryUseExponentialBackOffnofalseTo enable exponential backoff. Also configurable on the ResourceAdapter
useJndinofalsewhen true, use destination as a jndi name
Maximising Throughput of MDBs

If you want to maximise throughput of MDBs you should really set the maxSessions to something fairly large to increase the concurrency. Then set maxMessagesPerSessions to something big (say) 1000.

This assumes you have large numbers of messages available (say more than maxSessions * maxMessagesPerSession). Otherwise the prefetch will end up starving other consumers.

So if you don't have that many messages available, but maybe they take a while to process then you might want to set a lower value of maxMessagesPerSessions