Home > Store > Programming > Java
Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform
- By Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase
- Published Feb 26, 2002 by Addison-Wesley Professional. Part of the Java Series series.
- Copyright 2002
- Dimensions: 7-3/8x9-1/4
- Pages: 544
- Edition: 1st
- Book
- ISBN-10: 0-201-78472-6
- ISBN-13: 978-0-201-78472-5
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
Mark Hapner is Lead Architect for the Java 2 Platform, Enterprise Edition. He participated in the development of the JDBC API, wrote the Java Message Service specification, and co-authored the Enterprise JavaBeans specification.
Rich Burridge is a Staff Engineer at Sun Microsystems, where he has worked for over fifteen years. Currently with the Accessibility group, he is the creator of the Java Shared Data Toolkit (JSDT) and a coauthor of the Java Message Service API specification. Previously he worked on the "Netscape 6 for Solaris," OpenStep, and OpenWindows products.
Rahul Sharma is the lead architect of the J2EE Connector architecture and a Senior Staff Engineer at the Java Software division of Sun Microsystems, Inc. Presently, he is the lead architect of the JAX-RPC (Java APIs for XML based RPC) 1.0. Rahul has been with Sun for the last five years. Rahul holds a computer engineering degree from the Delhi University, India, and an MBA from the Haas School of Business, UC Berkeley.
Joseph Fialli is a Senior Staff Engineer at Sun Microsystems, where he has worked for the past four years. Currently, he is the lead architect for the Java Architecture for XML Binding (JAXB). Previously, he was the technical lead for the Java Message Service API within the J2EE Software Development Kit, version1.3, and maintained Java serialization within the Java 2 Platform, Standard Edition, version 1.2.
Kim Haase is a staff writer with Sun Microsystems, where she documents the J2EE platform. In previous positions she has documented compilers, debuggers, and floating-point programming. She currently writes about the Java Message Service and J2EE SDK tools.
Java Message Service API Tutorial and Reference provides a clear and complete introduction to the Java Message Service (JMS) API. This book illustrates how to use the JMS API to build applications that create, send, receive, and read messages. Beginning with comprehensive descriptions of fundamental JMS concepts and building blocks, the coverage extends to all aspects of running and creating JMS applications. Each topic area is supported by relevant and well-crafted JMS program examples that demonstrate how to put the technology to work.
The JMS API is an integral part of the Java 2 Platform, Enterprise Edition (J2EE platform). Developed by Sun Microsystems in close cooperation with enterprise messaging partners, JMS works together with other technologies to provide reliable, asynchronous communication between components in a distributed computing environment. It delivers a new, powerful tool for enterprise messaging--the cornerstone of today's enterprise applications.
You will find in-depth coverage on how to:
- Create and run JMS client programs
- Use the JMS API within the J2EE platform
- Consume messages asynchronously with a message-driven bean
- Produce messages from an application client and from a session bean
- Access an entity bean from a message-driven bean
- Create applications for the J2EE platform that use the JMS API to Consume messages Produce messages Access an entity bean
From BytesMessage to TransactionRolledBackException, a useful alphabetical reference provides complete information on all facets of the JMS API.
Additionally, the tutorial example programs are downloadable from the Sun Web site, so that you can adapt them to implementations of the JMS API and the J2EE platform.
Written by an expert team, the book offers an unparalleled technical understanding of JMS and its integration into the J2EE platform. Its thorough and practical coverage of JMS makes it easy for developers working in a distributed Java technology environment, and those familiar with the J2EE platform, to efficiently integrate the JMS API.
0201784726B02212002
|
12 of 12 people found the following review helpful
By
This review is from: Java¿ Message Service API Tutorial and Reference: Messaging for the J2EE¿ Platform (Paperback)
A lucid and authoritative description of Java MessageService, from Sun Microsystems, which developed and owns it. JMS is designed for an environment of distributed computers, where applications need to communicate with each other and databases across the network. You can think of JMS as one of the enablers of Sun's longtime slogan "The Network IS The Computer". JMS is loosely coupled distributed networking, where The book emphasises this, with detailed examples of
3 of 4 people found the following review helpful
By
This review is from: Java¿ Message Service API Tutorial and Reference: Messaging for the J2EE¿ Platform (Paperback)
With the increase of the popularity of loosely-coupled systems in enterprise integration and various serviced-oriented application architectures, messaging-based standards and strategies is geting more and more widely utilized. JMS is a JAVA based message framework (and standard), it allows application components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.The book provides all the bits to get you started quickly as well as provides fair details about the architecture of JMS and its API programming model. Various sample applications and code snippets were supplied for better understanding the technology. It is a really good and concise tutorial on the topic
0 of 11 people found the following review helpful
By "dotcomguy_oo7" (India) - See all my reviews
This review is from: Java¿ Message Service API Tutorial and Reference: Messaging for the J2EE¿ Platform (Paperback)
Covers reasonable amount of JMS. As an SCJA I recommand this book, since you don't have much choices this should do !!
|
› See all 3 customer reviews...
Online Sample Chapter
Introduction to the JMS API Programming Model
Table of Contents
Preface.
Acknowledgments.
I. OVERVIEW.
II. BYTESMESSAGE.
Preface
The Java Message Service Tutorial and Reference provides an introduction to the Java Message Service (JMS) API for new users. It has the following goals:
- To introduce the JMS API to new users, with simple JMS client program examples
- To show how to use the JMS API within the Java 2 Platform, Enterprise Edition (J2EE platform), with additional simple examples showing how to
- Consume messages asynchronously with a message-driven bean
- Produce messages from an application client
- Produce messages from a session bean
- Access an entity bean from a message-driven bean
- Produce and consume messages on more than one system
- To provide a full reference to the JMS API for JMS client programmers
The audience for this book is programmers who expect to write JMS applications, especially applications for the J2EE platform ("J2EE applications") that use the JMS API. We assume that you are familiar with the Java programming language and that you have some experience with earlier versions of the J2EE platform.
In order to run the tutorial examples, we recommend that you download and install the Java 2 Software Development Kit, Enterprise Edition (J2EE SDK), version 1.3 or above, which is available at no charge and runs on the Solaris Operating Environment and on the Linux and Windows NT/2000 operating systems. See http://java.sun.com/j2ee/ for more information and a link to the J2EE SDK. You should first install the required version of the Java 2 Software Development Kit, Standard Edition (J2SE SDK), if it is not already installed.
You can download the examples in this book, along with an HTML version of the tutorial, from the following location: http://java.sun.com/products/jms/tutorial/. The downloaded examples are in a directory named jms_tutorial/examples (on UNIX(R) systems) or jms_tutorial\examples (on Microsoft Windows systems).
You may adapt the examples to other implementations of the JMS API and the J2EE platform, but you will need to study your vendor's documentation to determine how to modify the parts of the examples and instructions that deal with external resources, such as JMS administered objects (connection factories and destinations) and databases. For the J2EE platform examples, you will also need to adapt the instructions to use your vendor's packaging and deployment tools.
Part Two, the reference, is based on the API documentation for JMS version 1.0.2b. The reference describes all parts of the API that apply to JMS application programmers. It does not describe the methods and interfaces that are used only for implementing a JMS provider.
This book uses a few simple documentation conventions:
Monospace fontis used for code, which includes what would be typed in a source code file or on the command line, URLs, file names, keywords, and names of classes, interfaces, exceptions, constructors, methods, and fields.Italic code fontis used for variables in text, command lines, and method explanations.- Italic font is used for introducing new terms, for book titles, and for emphasis.
We welcome your comments, questions, and suggestions. Please send them to the following e-mail address: jms-book@sun.com.
Errata for this book and information on other books in the Addison-Wesley Java series will be posted at http://java.sun.com/Series.0201784726P02132002
Downloadable Sample Chapter
Click below for Sample Chapter related to this title:
hapnerch03.pdf
Index
A
acknowledge method (Message interface) 57, 286
acknowledging messages. See message acknowledgment
administered objects 16
- J2EE applications and 68
- See also connection factories, destinations
application clients
- coding 77, 99, 126, 177
- packaging 84, 111, 157, 191
- running 94, 119, 172, 200, 208
- packaging 84, 111, 157, 191
Application Deployment Tool. See deploytool command
applications
- client 27, 201, 429
- J2EE 67, 75, 97, 123, 175
asynchronous message consumption 13
- getMessageListener method (MessageConsumer interface) 311
- MessageListener interface 319
- setMessageListener method (MessageConsumer interface) 313
- See also message-driven beans
- MessageListener interface 319
authentication
- createQueueConnection method (QueueConnectionFactory interface) 346
- createTopicConnection method (TopicConnectionFactory interface) 402
- JMSSecurityException class 257
- createTopicConnection method (TopicConnectionFactory interface) 402
AUTO_ACKNOWLEDGE mode
- example 464
- Session interface field 57, 370
bean-managed transactions 72
BytesMessage interface 25, 211
- readBoolean method 213
- readByte method 213
- readBytes method 214
- readChar method 215
- readDouble method 216
- readFloat method 216
- readInt method 216
- readLong method 217
- readShort method 217
- readUnsignedByte method 217
- readUnsignedShort method 218
- readUTF method 218
- reset method 219
- writeBoolean method 219
- writeByte method 219
- writeBytes method 220
- writeChar method 221
- writeDouble method 221
- writeFloat method 221
- writeInt method 222
- writeLong method 222
- writeObject method 222
- writeShort method 223
- writeUTF method 223
- readByte method 213
CLASSPATH environment variable 28
clearBody method (Message interface) 287
clearProperties method (Message interface) 287
client applications 27, 429
- compiling 37, 48
- running 38, 49
- running on multiple systems 51
- running 38, 49
client applications (cont.)
- running remotely 52
client ID, for durable subscriptions 61, 110
- getClientID method (Connection interface) 228
- InvalidClientIDException class 247
- setClientID method (Connection interface) 229
- InvalidClientIDException class 247
CLIENT_ACKNOWLEDGE mode
- example 464
- Session interface field 57, 370
close method
- Connection interface 227
- MessageConsumer interface 310
- MessageProducer interface 326
- QueueBrowser interface 340
- QueueRequestor class 350
- Session interface 371
- TopicRequestor class 410
- MessageConsumer interface 310
Cloudscape database server
- starting 157
- stopping 173
commands
- cloudscape 157, 173
- deploytool 83, 109, 156, 189
- j2ee 37, 50, 83, 95, 109, 121, 156, 173, 189, 201
- j2eeadmin 17, 18, 95, 110, 121, 173, 189, 201
- runclient 94, 119, 172, 200, 208
- deploytool 83, 109, 156, 189
commit method (Session interface) 64, 371
connection factories
- ConnectionFactory interface 233
- creating 51, 110, 189
- deleting 121, 201
- introduction 17
- QueueConnectionFactory interface 345
- specifying for deployment 86, 88, 114, 116, 159, 162, 164, 166, 168, 192, 196
- specifying for remote servers 51, 189
- TopicConnectionFactory interface 401
- creating 51, 110, 189
Connection interface 225
- close method 227
- getClientID method 228
- getExceptionListener method 228
- getMetaData method 228
- setClientID method 229
- setExceptionListener method 230
- start method 230
- stop method 231
- getClientID method 228
ConnectionFactory interface 233
ConnectionMetaData interface 235
- getJMSMinorVersion method 236
- getJMSProviderName method 236
- getJMSVersion method 237
- getJMSXPropertyNames method 237
- getProviderMajorVersion method 237
- getProviderMinorVersion method 238
- getProviderVersion method 238
- getJMSProviderName method 236
connections
- close method (Connection interface) 227
- Connection interface 225
- ConnectionMetaData interface 235
- createQueueConnection method (QueueConnectionFactory interface) 346
- createTopicConnection method (TopicConnectionFactory interface) 402
- introduction 18
- managing in J2EE applications 68
- QueueConnection interface 343
- start method (Connection interface) 230
- stop method (Connection interface) 231
- TopicConnection interface 399
- Connection interface 225
container, EJB 7
- message-driven beans 69
container-managed transactions 72, 88
createBrowser method (QueueSession interface) 360
createBytesMessage method (Session interface) 372
createDurableSubscriber method (TopicSession interface) 414-415
createMapMessage method (Session interface) 372
createMessage method (Session interface) 372
createObjectMessage method (Session interface) 373
createPublisher method (TopicSession interface) 416
createQueue method (QueueSession interface) 361
createQueueConnection method (QueueConnectionFactory interface) 346
createQueueSession method (QueueConnection interface) 344
createReceiver method (QueueSession interface) 361-362
createSender method (QueueSession interface) 362
createStreamMessage method (Session interface) 373
createSubscriber method (TopicSession interface) 416-417
createTemporaryQueue method (QueueSession interface) 362
createTemporaryTopic method (TopicSession interface) 418
createTextMessage method (Session interface) 373-374
createTopic method (TopicSession interface) 418
createTopicConnection method (TopicConnectionFactory interface) 402
createTopicSession method (TopicConnection interface) 400
creating
- connection factories 17, 51, 110, 189
- J2EE applications 84, 111, 157
- queues 18, 37, 83, 156
- topics 18, 49, 110
- J2EE applications 84, 111, 157
DEFAULT_DELIVERY_MODE field (Message interface) 285
DEFAULT_PRIORITY field (Message interface) 286
DEFAULT_TIME_TO_LIVE field (Message interface) 286
delete method
- TemporaryQueue interface 392
- TemporaryTopic interface 394
deleting
- connection factories 121, 201
- queues 39
- topics 50, 121
- queues 39
delivery modes
- DEFAULT_DELIVERY_MODE field (Message interface) 285
- getDeliveryMode method (MessageProducer interface) 327
- getJMSDeliveryMode method (Message interface) 290
- introduction 58
- JMSDeliveryMode message header field 24
- setDeliveryMode method (MessageProducer interface) 328
- setJMSDeliveryMode method (Message interface) 301
- getDeliveryMode method (MessageProducer interface) 327
DeliveryMode interface 58, 239
- NON_PERSISTENT delivery mode 240
- PERSISTENT delivery mode 240
deployment descriptors
- creating and packaging 87
- JMS API-related elements 91
deploytool command 83, 109, 156, 189
deploytool command
- Descriptor Viewer 91
- New Application Client Wizard 84, 111, 157, 191
- New Enterprise Bean Wizard 87, 160, 163, 165, 194
- New Application Client Wizard 84, 111, 157, 191
Destination interface 241
destination-type deployment descriptor element 91
destinations
- Destination interface 241
- getJMSDestination method (Message interface) 291
- introduction 18
- InvalidDestinationException class 249
- JMSDestination message header field 24
- Queue interface 337
- setJMSDestination method (Message interface) 302
- specifying for deployment 86, 88, 115-116, 162, 164, 166, 193, 196
- temporary 60
- Topic interface 397
- See also queues, temporary destinations, topics
- getJMSDestination method (Message interface) 291
di
This book includes free shipping and is available on demand.
- Request an Instructor or Media review copy.
- Corporate, Academic, and Employee Purchases
- International Buying Options
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.

