Chapter 16: Configuring, Deploying, and Using JMS Resources with Apache ActiveMQ


Chapter 12 focused on the deployment of an Enterprise Application in Geronimo. This chapter builds on those concepts and takes things a step further by focusing on enterprise messaging through the use of the Java Message Service (JMS). As the Java messaging standard, JMS is an integral part of the J2EE 1.4 specification. JMS provides an enterprise messaging API that supports both the queuing and publish-subscribe styles of messaging with guaranteed message delivery, receipt notification, and transactions. Through the use of JMS, business applications can exchange critical business events and data in an asynchronous manner. Geronimo provides support for JMS via Apache ActiveMQ.

ActiveMQ is an enterprise-level, Open Source message broker that provides high-performance, practically unlimited scalability, high reliability, and configuration flexibility. ActiveMQ is a JMS 1.1 message broker and supports TCP, UDP, SSL, HTTP, multicasting, Jabber (XMPP), Java Reliable Multicast Service (JRMS), JXTA, XA, J2EE Connector Architecture 1.5, and much, much more. Features include queues, topics, durable and nondurable messaging with pluggable security and persistence, wildcards, selectors, composite destinations, and XPath. ActiveMQ also supports high-speed journaling for the persistence of messages when handling very high throughput. Additional information on ActiveMQ can be found at the ActiveMQ Web site (www.activemq.org).

The ActiveMQ Message Broker Architecture

This section takes a brief look at the ActiveMQ architecture at a very high level. Figure 16-1 shows a diagram of the ActiveMQ architecture. Notice that the topology is centered upon the Topic Region and the Queue Region. First, focus on the connectors on the top of the diagram (HTTP, SSL/TCP, STOMP, WS-Notification). These connectors are J2EE Connector Architecture resource adapters. The inbound connections deliver messages to Message Driven Beans, whereas outbound connections provide support for the pooling of ActiveMQ instances. STOMP (Streamlining Text Oriented Messaging Protocol) provides a protocol for interacting with Message-Oriented Middleware from languages other than Java. The WS-Notification connector provides a bridge to the Web Services-Notification specification.

image from book
Figure 16-1: A diagram of the ActiveMQ architecture

In Figure 16-1, focus on the Network Services (Discovery, DR Clustering, Store & Forward) area on the right-hand side. Discovery refers to the auto-discovery of JMS clients and brokers on the network. DR Clustering refers to disaster recovery and clustering. Disaster recovery (DR) is the notion of configuring a cluster of brokers to replicate messages to another location for purposes of recovery in the event of a major catastrophe. Clustering includes a logical cluster of brokers, a cluster of consumers on a queue, and a network of brokers for massive scalability. Store & Forward refers to the concept of a broker receiving a message, storing it locally, sending it along to another broker, and deleting it only once it has been successfully received.

Now, focus on the bottom portion of Figure 16-1 named Message Store (JDBC, Journal, Cache, VM). These are adapters for various message-persistence mechanisms. JDBC is one option for the persistence of messages to a relational data source. The Journal option utilizes a high-speed journaling solution where messages are written to the journal at a very high rate, and the journal is checkpointed to long-term storage in batches. Cache refers to the caching layer just above the JDBC service and in-VM storage of messages. This diagram comes directly from the ActiveMQ Web site and provides a good high-level overview of the architecture.

This chapter discusses the configuration and deployment of the ActiveMQ message broker and its JMS resources, including connection factories and destinations (queues and topics). There are two pieces of ActiveMQ that matter to Geronimo: the message broker and the resource adapter. The message broker is packaged and deployed as a GBean archive, along with its configuration information. The JMS resources will be packaged and deployed as a resource adapter configuration in compliance with the J2EE Connector Architecture 1.5. These two concepts provide the basis for this chapter.

Upon completing this chapter, you should have a clear understanding of the use of the ActiveMQ message broker within the Geronimo server and how to configure and deploy JMS resources.




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