O'Reilly - Java Message Service (2001).pdf
(
1092 KB
)
Pobierz
O'Reilly - Java Message Service
Java Message Service
Richard Monson-Haefel
David A. Chappell
Publisher: O'Reilly
First Edition January 2001
ISBN: 0-596-00068-5, 238 pages
This book is a thorough introduction to Java Message Service (JMS) from Sun
Microsystems. It shows how to build applications using the point-to-point and publish-and-
subscribe models; use features like transactions and durable subscriptions to make
applications reliable; and use messaging within Enterprise JavaBeans. It also introduces a
new EJB type, the MessageDrivenBean, that is part of EJB 2.0, and discusses integration
of messaging into J2EE.
Team[oR]
Table of Contents
Preface ..............................................................................................................................1
What Is the Java Message Service?.................................................................................1
Who Should Read This Book?........................................................................................1
Organization...................................................................................................................2
Software and Versions ....................................................................................................3
Conventions ...................................................................................................................4
Comments and Questions ...............................................................................................4
Acknowledgments ..........................................................................................................5
Chapter 1. Understanding the Messaging Paradigm ......................................................6
1.1 Enterprise Messaging................................................................................................7
1.2 The Java Message Service (JMS) ..............................................................................9
1.3 Application Scenarios .............................................................................................11
1.4 RPC Versus Asynchronous Messaging ...................................................................15
Chapter 2. Developing a Simple Example .....................................................................19
2.1 The Chat Application..............................................................................................19
Chapter 3. Anatomy of a JMS Message.........................................................................33
3.1 Headers...................................................................................................................34
3.2 Properties................................................................................................................38
3.3 Message Selectors...................................................................................................40
3.4 Message Types .......................................................................................................42
Chapter 4. Publish-and-Subscribe Messaging...............................................................53
4.1 Getting Started with the B2B Application ...............................................................53
4.2 Temporary Topics...................................................................................................60
4.3 Durable Subscriptions .............................................................................................61
4.4 Publishing the Message Persistently........................................................................63
4.5 JMSCorrelationID...................................................................................................64
4.6 Request and Reply ..................................................................................................65
4.7 Unsubscribing.........................................................................................................68
Chapter 5. Point-to-Point Messaging.............................................................................69
5.1 Point-to-Point and Publish-and-Subscribe ...............................................................69
5.2 The QWholesaler and QRetailer..............................................................................71
5.3 Creating a Queue Dynamically ...............................................................................78
5.4 Load Balancing Using Multiple QueueSessions ......................................................79
5.5 Examining a Queue.................................................................................................80
Chapter 6. Guaranteed Messaging, Transactions, Acknowledgments & Failures ......84
6.1 Guaranteed Messaging ............................................................................................84
6.2 Message Acknowledgments....................................................................................85
6.3 Message Groups and Acknowledgment...................................................................91
6.4 Transacted Messages ..............................................................................................95
6.5 Lost Connections .................................................................................................. 104
6.6 Dead Message Queues .......................................................................................... 106
Chapter 7. Deployment Considerations....................................................................... 108
7.1 Performance, Scalability, and Reliability .............................................................. 108
7.2 To Multicast or Not to Multicast ........................................................................... 112
7.3 Security ................................................................................................................ 116
7.4 Connecting to the Outside World .......................................................................... 118
7.5 Bridging to Other Messaging Systems .................................................................. 120
Chapter 8. J2EE, EJB, and JMS.................................................................................. 122
8.1 J2EE Overview ..................................................................................................... 122
8.2 J2EE: A United Platform ...................................................................................... 125
8.3 The JMS Resource in J2EE................................................................................... 126
8.4 The New Message-Driven Bean in EJB 2.0........................................................... 128
Chapter 9. JMS Providers............................................................................................ 133
9.1 IBM: MQSeries .................................................................................................... 133
9.2 Progress: SonicMQ ............................................................................................... 134
9.3 Fiorano: FioranoMQ ............................................................................................. 135
9.4 Softwired: iBus ..................................................................................................... 136
9.5 Sun Microsystems: Java Message Queue .............................................................. 138
9.6 BEA: WebLogic Server ........................................................................................ 139
9.7 ExoLab: OpenJMS................................................................................................ 140
Appendix A. The Java Message Service API............................................................... 141
A.1 Common Facilities ............................................................................................... 141
A.2 Point-to-Point API ............................................................................................... 150
A.3 Publish-and-Subscribe API .................................................................................. 153
Appendix B. Message Headers..................................................................................... 156
Appendix C. Message Properties ................................................................................. 167
C.1 Property Names.................................................................................................... 167
C.2 Property Values.................................................................................................... 167
C.3 Read-Only Properties ........................................................................................... 169
C.4 Property Value Conversion .................................................................................. 169
C.5 Nonexistent Properties ......................................................................................... 171
C.6 Property Iteration ................................................................................................. 171
C.7 JMS-Defined Properties ....................................................................................... 171
C.8 Provider-Specific Properties ................................................................................. 173
Appendix D. Message Selectors.................................................................................... 174
D.1 Identifiers ............................................................................................................ 174
D.2 Literals................................................................................................................. 174
D.3 Comparison Operators ......................................................................................... 175
D.4 Arithmetic Operators............................................................................................ 177
D.5 Declaring a Message Selector .............................................................................. 178
D.6 Not Delivered Semantics...................................................................................... 179
Colophon....................................................................................................................... 180
Java Message Service
Preface
What Is the Java Message Service?
When Java™ was first introduced, most of the IT industry focused on its graphical user
interface characteristics and the competitive advantage it offered in terms of distribution
and platform independence. Today, the focus has broadened considerably: Java has been
recognized as an excellent platform for creating enterprise solutions, specifically for
developing distributed server-side applications. This shift has much to do with Java's
emerging role as a universal language for producing implementation-independent
abstractions for common enterprise technologies. The JDBC™ API is the first and most
familiar example. JDBC provides a vendor-independent Java interface for accessing SQL
relational databases. This abstraction has been so successful that it's difficult to find a
relational database vendor that doesn't support JDBC. Java abstractions for enterprise
technologies have expanded considerably to include JNDI (Java Naming and Directory
Interface™) for abstracting directory services, JMX (Java Management Extensions) for
abstracting access to computer devices on a network, and JMS™ (Java Message Service)
for abstracting access to different Message-Oriented Middleware products.
JMS has quickly become a de facto industry standard. In its second version, most
enterprise messaging vendors now support the JMS specification, making for a large
selection of JMS providers to choose from.
The Java Message Service is a Java API implemented by enterprise messaging vendors to
provide Java applications with a common and elegant programming model that is portable
across messaging systems. Enterprise messaging systems are used to send notification of
events and data between software applications. There are two common programming
models supported by the JMS API: publish-and-subscribe and point-to-point. Each model
provides benefits and either or both may be implemented by JMS providers.
JMS and enterprise messaging systems provide Java developers with an asynchronous
messaging system that allows systems to interact without requiring them to be tightly
coupled. Messages can be delivered to systems that are not currently running and
processed when it's convenient. The decoupled, asynchronous characteristics of enterprise
messaging make JMS an extremely powerful and critical enterprise API. JMS is used by
Java developers in Enterprise Application Integration, Business-to-Business (B2B)
projects, and distributed computing in general.
As JMS quickly moves into the forefront as one of the most important J2EE technologies,
understanding how JMS works and when to use it will become the hallmark of the most
successful distributed computing professionals. Choosing to read this book to learn about
JMS may be one of the smartest career moves you ever make.
Who Should Read This Book?
This book explains and demonstrates the fundamentals of the Java Message Service. This
book provides a straightforward, no-nonsense explanation of the underlying technology,
Java classes and interfaces, programming models, and various implemenations of the JMS
specification.
1
Plik z chomika:
Witek63
Inne pliki z tego folderu:
Wrox - J2EE Design Patterns Applied (Chapter 5) (2002).pdf
(1437 KB)
Wrox - Professional J2EE with BEA WebLogic Server (2000).pdf
(4123 KB)
Wrox - J2EE Design Patterns Applied (Chapter 3) (2002).pdf
(535 KB)
Wrox - Expert One-on-One - J2EE Development without EJB (2004).pdf
(8141 KB)
Wordware - JBuilder 8.0 - JFC and Swing Programming (2003).pdf
(6648 KB)
Inne foldery tego chomika:
C ++ - programowanie - kurs video PL (video tutorial PL)
C++ Programowanie PL
C++ Qt Programming
CodeIgniter
Complete IT Books Pack
Zgłoś jeśli
naruszono regulamin