Jms User's Guide; Jms Is Pre-Installed And Configured; Writing Jms Operations Within An Application Component - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

This chapter is provided for advanced JOnAS users concerned with JMS (Java Message Service).
As required by the J2EE v1.4 specification, application components (servlets and enterprise beans)
can use JMS for Java messaging. Furthermore, applications can use Message-driven Beans (MDBs)
for asynchronous EJB method invocation, as specified by the EJB 2.1 specification.
JOnAS supports the JMS 1.1 specification, which offers a domain-independent approach to pro-
gramming the client application. Priot to JMS 1.1, client programming for point-to-point and pub-
lish/subscribe domains was achieved using similar, but separate, class hierarchies. With JMS 1.1, it is
now possible to engage queues and topics in the same transaction.
Enterprise Bean providers can use JMS connection factory resources via resource references, and
JMS destination resources (JMS queues and JMS topics) via resource environment references. Thus,
they are able to provide JMS code, inside an EJB method or web component method, for sending or
synchronously receiving messages to/from a JMS queue or topic.
The EJB container and the Web container can allow for JMS operations within a global transaction,
which may include other resources such as databases.
JOnAS integrates a third-party JMS implementation, JORAM (http://joram.objectweb.org/), which is
the default JMS service, and for which a J2EE1.4 compliant Resource Adapter archive file is also
provided. Other JMS providers, such as SwiftMQ (http://www.swiftmq.com/) and WebSphere MQ
(http://www-3.ibm.com/software/integration/mqfamily/), can easily be integrated.
A JMS provider can be integrated within JOnAS by deploying a corresponding resource adapter.
This is the preferred method as the JMS service will eventually become deprecated in future JOnAS
releases. Also, this method allows deployment of 2.1 MDBs (which is impossible with the JMS ser-
vice).
To perform JMS operations, application components use JMS-administered objects such as connec-
tion factories and destinations. Refer to Section 26.4 JMS Administration for an explanation of how
to create those objects.
26.1. JMS is Pre-installed and Configured
To use JMS with JOnAS, no additional installation or configuration operations are required. JOnAS
contains:
The Java[TM] Message Service API 1.1, currently integrated with the JOnAS distribution,
A JMS implementation. Currently, the OpenSource JORAM (http://joram.objectweb.org), is inte-
grated with the JOnAS distribution; thus no installation is necessary.
Additionally, another JMS implementation, the SwiftMQ product, has been used with JOnAS.

26.2. Writing JMS Operations Within an Application Component

To send (or synchronously receive) JMS messages, an application component requires access to JMS-
administered objects (that is, to connection factories for creating connections to JMS resources, and
to destination objects (queue or topic), which are the JMS entities used as destinations within JMS
sending operations). Both are made available through JNDI by the JMS provider administration facil-
ity.
Chapter 26.

JMS User's Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents