The ActiveMQ Resource Adapter


The ActiveMQ resource adapter is a J2EE Connector Architecture 1.5 (JCA) compliant adapter. JCA provides an independent and standardized mechanism for integrating with systems external to an application server via a standard set of contracts. JCA defines contracts for the management of lifecycle, connections, transactions, security, work, message inflow, and transaction inflow. Apache Geronimo supports JCA 1.5 and utilizes it to provide JMS resources and JDBC connection pooling. Through the use of a JCA resource adapter descriptor, the JMS resources will be packaged in a Resource Adapter Archive (RAR) and deployed into the Geronimo server.

You can think of the resource adapter as a driver for the ActiveMQ broker. It is common to change the composition of the ActiveMQ resource adapter by changing its configuration. Different situations call for different connection factories and/or destinations. This section explains the ActiveMQ resource adapter configuration.

JMS Resources

JMS resources include connection factories and destinations. In JMS parlance, these are known as administered objects. Administered objects are typically available from a JNDI environment naming context (ENC) and are vital for a message broker because they’re for use by JMS clients.

Connection Factories

Connection factories are used to create connections to and sessions for a JMS provider. These connections can be created either for queues or topics, and provide the capability to require authentication. Connections can also be used to create JMS sessions.

Sessions

Sessions are used to create message producers and consumers for particular destinations and have the capability to be transaction bound.

Destinations

Destination objects are used by JMS clients to send and receive messages. There are two standard types of destinations: a queue and a topic. Queues are used by the point-to-point messaging paradigm, while topics are used by the publish-subscribe messaging paradigm.

J2EE Connector Architecture and JMS Resources

The RAR file mentioned earlier is packaged using the jar tool and must include a deployment descriptor in a META-INF directory, as well as any additional necessary elements (such as Java classes, native libraries, and any documentation and images). These contents are broken down in Table 16-2.

Table 16-2: The RAR File Contents
Open table as spreadsheet

Item

Required

Location

Deployment Descriptor

Yes

META-INF/ra.xml

Documentation

No

Arbitrary

Dependent Classes

No

Arbitrary

Native Libraries

No

Arbitrary

The deployment of these resources takes place via the resource adapter deployment descriptor and the repository/geronimo/activemq-rar/1.1/activemq-rar-1.1.rar file. The contents of this RAR file are shown in Listing 16-2.

Listing 16-2: The Contents of the activemq-rar-1.1.rar File

image from book
  META-INF/ META-INF/MANIFEST.MF META-INF/ra.xml activemq-core-3.2.4.jar activemq-ra-3.2.4.jar META-INF/LICENSE.txt 
image from book

The main item in the activemq-rar-1.1.rar file is the activemq-ra-3.2.4.jar file. This is a JCA resource adapter from the ActiveMQ project, so it’s not specific to only Geronimo. This component facilitates integration between any J2EE 1.4 container and the ActiveMQ message broker to control transactions, manage security, and pool connections.




Professional Apache Geronimo
Professional Apache Geronimo (Wrox Professional Guides)
ISBN: 0471785431
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net