It is assumed at this point that the JOnAS server will make use of an existing JMS implementation; for example, JORAM or SwiftMQ.
The default policy is that the MDB developer and deployer are not concerned with JMS administration. This means that the developer/deployer will not create or use any JMS Connection factories and will not create a JMS destination (which is necessary for performing JMS operations within an EJB component (see Chapter 26 JMS User's Guide)); they will simply define the type of destination in the deployment descriptor and identify its JNDI name in the JOnAS-specific deployment descriptor, as described in the previous section. This means that JOnAS will implicitly create the necessary administered objects by using the proprietary administration APIs of the JMS implementation (since the administration APIs are not standardized). To perform such administration operations, JOnAS uses wrappers to the JMS provider administration API. For JORAM, the wrapper is org.objectweb.jonas_jms.JmsAdminForJoram (which is the default wrapper class defined by the jonas.service.jms.mom property in the jonas.properties file). For SwiftMQ, a com.swiftmq.appserver.jonas.JmsAdminForSwiftMQ class can be obtained from the SwiftMQ site.
For the purpose of this implicit administration phase, the deployer must add the "jms" service in the list of the JOnAS services. For the example provided, the jonas.properties file should contain the following:
jonas.services registry,security,jtm,dbm,jms,ejb // The jms service must be added jonas.service.ejb.descriptors samplemdb.jar jonas.service.jms.topics sampleTopic // not mandatory |
The destination objects may or may not pre-exist. The EJB server will not create the corresponding JMS destination object if it already exists. (Refer also to Section 26.4 JMS Administration). The sampleTopic should be explicitly declared only if the JOnAS Server is going to create it first, even if the Message-Driven Bean is not loaded, or if it is use by another client before the Message-Driven Bean is loaded. In general, it is not necessary to declare the sampleTopic.
JOnAS uses a pool of threads for executing Message-Driven Bean instances on message reception, thus allowing large volumes of messages to be processed concurrently. As previously explained, MDB instances are stateless and several instances can execute concurrently on behalf of the same MDB. The default size of the pool of thread is 10, and it may be customized via the jonas property jonas.service.ejb.mdbthreadpoolsize, which is specified in the jonas.properties file as in the following example:
jonas.service.ejb.mdbthreadpoolsize 50 |