出版時(shí)間:2010-1 出版社:東南大學(xué)出版社 作者:(美)布朗 等著 頁數(shù):305
前言
When I was presented with the opportunity to revise Java Message Service, I jumped at the chance. The first edition, published by O'Reilly in 2000, was a bestseller and without a doubt the definitive source for JMS and messaging in general at that time.Writing the second edition was an exciting chance to breath new life into an already great book and add new content that was relevant to how we use messaging today.What I failed to fully realize when I took on the project was just how much messaging(or, more precisely, how we use messaging) has changed in the past 10 years. New messaging techniques and technologies have been developed, including messagedriven beans (as part of the EJB specification), the Spring messaging framework, Event Driven Architecture, Service-Oriented Architecture, RESTful JMS interfaces, and the Enterprise Service Bus (ESB), to name a few. The somewhat minor book project that I originally planned quickly turned into a major book project. My original intent was to preserve as much of the original content as possible in this new edition. However, based on changes to the JMS specification since the first edition was written, as well as the development of new messaging techniques and technologies,the original content quickly shrank. As a result, you will find that roughly 75% of this second edition is new or revised content. The JMS specification was updated to version 1.1 a couple of years after the printing of the first edition of this book. While not a major change to the JMS specification, the JMS 1.1 specification was nevertheless a significant step toward fixing some of the deficiencies with the original JMS specification. One of the biggest changes in the specification was the joining of the queue and topic APl under a unified general APl,allowing queues and topics to share the same transactional unit of work. However, the specification change alone was not the only factor that warranted a second edition of the book. As the Java platform has matured, so has the way we think about messaging.From new messaging technologies and frameworks to complex integration and throughput requirements, messaging has changed the way we think about and design systems, particularly over the past 10 years. These factors, combined with the specification changes, are the reasons for the second edition.
內(nèi)容概要
《Java消息服務(wù)》第二版,是對(duì)標(biāo)準(zhǔn)API的一個(gè)徹底詳盡的介紹——它支持消息傳遞,即網(wǎng)絡(luò)計(jì)算機(jī)間的關(guān)鍵數(shù)據(jù)從軟件到軟件的交換。你將學(xué)習(xí)到JMS如何幫助你解決許多架構(gòu)難題,如整合不同的系統(tǒng)和應(yīng)用程序,增加可擴(kuò)展性,消除系統(tǒng)瓶頸,支持并行處理,提升靈活性和敏捷性。由于更新了JMS 1.1,第二版還說明了廠商無關(guān)的規(guī)范將有助于你寫基于messaging的應(yīng)用程序,無論是使用IBM的MQ、Progress軟件的SonicMQ、ActiveMQ的,還是其他專有的消息服務(wù)。 有了《Java消息服務(wù)》,你將可以: 使用點(diǎn)對(duì)點(diǎn)和出版與訂閱消息傳遞模型建立應(yīng)用程序 使用如事務(wù)和持久訂閱功能,以使應(yīng)用程序可靠 使用消息驅(qū)動(dòng)的beans在Enterprise JavaBeans(EJB)中實(shí)現(xiàn)消息傳遞 使用JMS時(shí)結(jié)合RESTful應(yīng)用程序和Spring應(yīng)用程序框架 消息傳遞是一個(gè)強(qiáng)大的范例,可以更容易地使企業(yè)應(yīng)用程序的不同部分分離?!禞ava消息服務(wù)》第二版將迅速教會(huì)你如何運(yùn)用其背后的關(guān)鍵技術(shù)。
作者簡(jiǎn)介
布朗(Mark Richards),一位實(shí)踐經(jīng)驗(yàn)豐富的設(shè)計(jì)師,也是一位在消息傳遞、系統(tǒng)集成和面向服務(wù)的架構(gòu)方面有領(lǐng)導(dǎo)地位的專家和作家。Richard Monson-Haefel,O’Reilly 出版的《Enterprise JavaBeans》和《Java消息服務(wù)》第一版的合著者,是企業(yè)計(jì)算方面的世界級(jí)專家。David A. Chappell,Oracle公司副總裁兼SOA首席技術(shù)專家,是《Java Web Services》和《Java消息服務(wù)》第一版(均為O’Reilly出版)的合著者。
書籍目錄
ForewordPreface1. Messaging Basics The Advantages of Messaging Heterogeneous Integration Reduce System Bottlenecks Increase Scalability Increase End User Productivity Architecture Flexibility and Agility Enterprise Messaging Centralized Architectures Decentralized Architectures Hybrid Architectures Centralized Architecture As a Model Messaging Models Point-to-Point Publish-and-Subscribe JMS API Point-to-Point API Publish-and-Subscribe API Real-World Scenarios Service-Oriented Architecture Event-Driven Architecture Heterogeneous Platform Integration Enterprise Application Integration Business-to-Business Geographic Dispersion Information Broadcasting Building Dynamic Systems RPC Versus Asynchronous Messaging Tightly Coupled RPC Enterprise Messaging2. Developing a Simple Example The Chat Application Getting Started with the Chat Example Examining the Source Code Sessions and Threading3. Anatomy of a JMS Message Headers Automatically Assigned Headers Developer-Assigned Headers Properties Application-Specific Properties JMS-Defined Properties Provider-Specific Properties Message Types Message TextMessage ObjectMessage BytesMessage StreamMessage MapMessage Read-Only Messages Client-Acknowledged Messages Interoperability and Portability of Messages4. Point-to-Point Messaging Point-to-Point Overview When to Use Point-to-Point Messaging The QBorrower and QLender Application Configuring and Running the Application The QBorrower Class The QLender Class Message Correlation Dynamic Versus Administered Queues Load Balancing Using Multiple Receivers Examining a Queue5. Publish-and-Subscribe Messaging Publish-and-Subscribe Overview When to Use Publish-and-Subscribe Messaging The TBorrower and TLender Application Configuring and Running the Application The TLender Class The TBorrower Class Durable Versus Nondurable Subscribers Dynamic Versus Administered Subscribers Unsubscribing Dynamic Durable Subscribers Temporary Topics6. Message Filtering Message Selectors Identifiers Literals Comparison Operators Arithmetic Operators Declaring a Message Selector Message Selector Examples Managing Claims in an HMO Notification of Certain Bids on Inventory Priority Handling Stock Trade Order Auditing Not Delivered Semantics Design Considerations7. Guaranteed Messaging and Transactions Guaranteed Messaging Message Autonomy Store-and-Forward Messaging Message Acknowledgments and Failure Conditions Message Acknowledgments AUTO_ACKNOWLEDGE DUPS_OK_ACKNOWLEDGE CLIENT_ACKNOWLEDGE Message Groups and Acknowledgment Handling Redelivery of Messages in an Application Message Groups Example Message Grouping and Multiple Receivers Transacted Messages Creating and Using a JMS Transaction Transacted Session Example Distributed Transactions Lost Connections The ExceptionListener Example Dead Message Queues8. Java EE and Message-Driven Beans Java EE Overview Enterprise JavaBeans Enterprise JavaBeans 3.0 (EJB3) Overview Simplified Bean Development Dependency Injection Simplified Callback Methods Programmatic Defaults Interceptors Java Persistence API JMS Resources in Java EE The JNDI Environment Naming Context (ENC) Message-Driven Beans Concurrent Processing and Scalability Defining Message-Driven Beans Message-Driven Bean Use Cases Message Facade Transformation and Routing9. Spring and JMS Spring Messaging Architecture JmsTemplate Overview Send Methods convertAndSend Methods receive and receiveSelected Methods receiveAndConvert Methods Connection Factories and JMS Destinations Using JNDI Using Native Classes Sending Messages Using the send Method Using the convertAndSend Method Using a Nondefault JMS Destination Receiving Messages Synchronously Message-Driven POJOs The Spring Message Listener Container MDP Option 1: Using the MessageListener Interface MDP Option 2: Using the SessionAwareMessageListener Interface MDP Option 3: Using the MessageListenerAdapter Message Conversion Limitations The Spring JMS Namespace [jms:listener-container] Element Properties [jms:listener] Element Properties10. Deployment Considerations Performance, Scalability, and Reliability Determining Message Throughput Requirements Testing the Real-World Scenario To Multicast or Not to Multicast TCP/IP UDP IP Multicast Messaging Over IP Multicast The Bottom Line Security Authentication Authorization Secure Communication Firewalls and HTTP Tunneling Connecting to the Outside World Bridging to Other Messaging Systems11. Messaging Design Considerations Internal Versus External Destination Internal Destination Topology External Destination Topology Request/Reply Messaging Design Messaging Design Anti-Patterns Single-Purpose Queue Message Priority Overuse Message Header MisuseA. The Java Message Service APIB. Message HeadersC. Message PropertiesD. Installing and Configuring ActiveMQIndex
章節(jié)摘錄
插圖:Event-Driven Architecture (EDA) is an architecture style that is built on the premisethat the orchestration of processes and events is dynamic and very complex, and there-fore not feasible to control or implement through a central orchestration component.When an action takes place in a system, that process sends an event to the entire systemstating that an action took place (an event). That event may then kick off other pro-cesses, which in turn may kick off additional processes, all decoupled from each other.Some good examples of EDA include the insurance domain and the defined benefitsdomain. Both of these industry domains are driven by events that happen in the system.For example, something as simple as changing your address can affect many aspects ofthe insurance domain, including policies, quotes, and customer records. In this case,the driving event in the insurance application is an address change. However, it is notthe responsibility of the address change module to know everything that needs to happen as a result of that event. Therefore, the address change module sends an eventmessage letting the system know that an address has changed. The quoting system willpick up that event and adjust any outstanding quotes that may be present for thatcustomer. Simultaneously, the policy system will pick up the change address event andadjust the rates and policies for that customer.Another example of EDA is within the defined benefits domain. Getting married orchanging jobs triggers events in the system that qualify you for certain changes to yourhealth and retirement benefits. Many of these systems use EDA to avoid using a large,complex, and unmaintainable central processing engine to control all of the actionsassociated with a particular "qualifying event."Messaging is the foundation for systems based on an Event-Driven Architecture. Eventsare typically implemented as empty payload messages containing some informationabout the event in the header of the message, although some pass the application dataas part of the event. Not surprisingly, most architectures based on EDA leverage thepub/sub model as a means of broadcasting the events within a system.
媒體關(guān)注與評(píng)論
“這是對(duì)基本的Java集成技術(shù)的一個(gè)深度論述,涵蓋了恰當(dāng)程度的JMS API細(xì)節(jié),并考慮周全地把開放源碼解決方案并入需要了解的Enterprise Java的話題討論?!? ——Tim Berglund,August科技集團(tuán)董事長(zhǎng)
編輯推薦
《Java消息服務(wù)(第2版·影印版)》由東南大學(xué)出版社出版。
圖書封面
評(píng)論、評(píng)分、閱讀與下載