《Java消息服务 影印版》PDF下载

  • 购买积分:12 如何计算积分?
  • 作  者:MarkRichards,RichardMonson-Haefel著
  • 出 版 社:南京:东南大学出版社
  • 出版年份:2010
  • ISBN:9787564119300
  • 页数:307 页
图书介绍:《Java消息服务》第二版,是对标准API的一个彻底详尽的介绍——它支持消息传递,即网络计算机间的关键数据从软件到软件的交换。你将学习到JMS如何帮助你解决许多架构难题,如整合不同的系统和应用程序,增加可扩展性,消除系统瓶颈,支持并行处理,提升灵活性和敏捷性。

1.Messaging Basics 1

The Advantages of Messaging 3

Heterogeneous Integration 3

Reduce System Bottlenecks 3

Increase Scalability 4

Increase End User Productivity 4

Architecture Flexibility and Agility 5

Enterprise Messaging 5

Centralized Architectures 7

Decentralized Architectures 7

Hybrid Architectures 8

Centralized Architecture As a Model 8

Messaging Models 9

Point-to-Point 10

Publish-and-Subscribe 10

JMS API 11

Point-to-Point API 13

Publish-and-Subscribe API 14

Real-World Scenarios 14

Service-Oriented Architecture 15

Event-Driven Architecture 16

Heterogeneous Platform Integration 16

Enterprise Application Integration 17

Business-to-Business 17

Geographic Dispersion 18

Information Broadcasting 18

Building Dynamic Systems 18

RPC Versus Asynchronous Messaging 21

Tightly Coupled RPC 21

Enterprise Messaging 23

2.Developing a Simple Example 25

The Chat Application 25

Getting Started with the Chat Example 28

Examining the Source Code 30

Sessions and Threading 39

3.Anatomy of a JMS Message 41

Headers 42

Automatically Assigned Headers 43

Developer-Assigned Headers 46

Properties 47

Application-Specific Properties 47

JMS-Defined Properties 49

Provider-Specific Properties 50

Message Types 50

Message 50

TextMessage 51

ObjectMessage 52

BytesMessage 53

StreamMessage 56

MapMessage 58

Read-Only Messages 60

Client-Acknowledged Messages 61

Interoperability and Portability of Messages 61

4.Point-to-Point Messaging 63

Point-to-Point Overview 63

When to Use Point-to-Point Messaging 66

The QBorrower and QLender Application 67

Configuring and Running the Application 67

The QBorrower Class 69

The QLender Class 76

Message Correlation 81

Dynamic Versus Administered Queues 83

Load Balancing Using Multiple Receivers 84

Examining a Queue 85

5.Publish-and-Subscribe Messaging 87

Publish-and-Subscribe Overview 87

When to Use Publish-and-Subscribe Messaging 89

The TBorrower and TLender Application 90

Configuring and Running the Application 90

The TLender Class 92

The TBorrower Class 96

Durable Versus Nondurable Subscribers 100

Dynamic Versus Administered Subscribers 101

Unsubscribing Dynamic Durable Subscribers 104

Temporary Topics 104

6.Message Filtering 107

Message Selectors 109

Identifiers 110

Literals 111

Comparison Operators 111

Arithmetic Operators 113

Declaring a Message Selector 114

Message Selector Examples 116

Managing Claims in an HMO 116

Notification of Certain Bids on Inventory 116

Priority Handling 116

Stock Trade Order Auditing 117

Not Delivered Semantics 117

Design Considerations 118

7.Guaranteed Messaging and Transactions 125

Guaranteed Messaging 125

Message Autonomy 126

Store-and-Forward Messaging 126

Message Acknowledgments and Failure Conditions 126

Message Acknowledgments 127

AUTO_ACKNOWLEDGE 127

DUPS_OK_ACKNOWLEDGE 132

CLIENT_ACKNOWLEDGE 132

Message Groups and Acknowledgment 133

Handling Redelivery of Messages in an Application 134

Message Groups Example 134

Message Grouping and Multiple Receivers 143

Transacted Messages 145

Creating and Using a JMS Transaction 147

Transacted Session Example 147

Distributed Transactions 150

Lost Connections 151

The ExceptionListener Example 152

Dead Message Queues 153

8.Java EE and Message-Driven Beans 155

Java EE Overview 155

Enterprise JavaBeans 156

Enterprise JavaBeans 3.0(EJB3)Overview 157

Simplified Bean Development 158

Dependency Injection 158

Simplified Callback Methods 159

Programmatic Defaults 159

Interceptors 160

Java Persistence API 162

JMS Resources in Java EE 162

The JNDI Environment Naming Context(ENC) 164

Message-Driven Beans 166

Concurrent Processing and Scalability 168

Defining Message-Driven Beans 168

Message-Driven Bean Use Cases 171

Message Facade 171

Transformation and Routing 173

9.Spring and JMS 177

Spring Messaging Architecture 177

JmsTemplate Overview 180

Send Methods 181

convertAndSend Methods 181

receive and receiveSelected Methods 182

receiveAndConvert Methods 183

Connection Factories and JMS Destinations 184

Using JNDI 184

Using Native Classes 187

Sending Messages 189

Using the send Method 190

Using the convertAndSend Method 191

Using a Nondefault JMS Destination 193

Receiving Messages Synchronously 195

Message-Driven POJOs 198

The Spring Message Listener Container 198

MDP Option 1:Using the MessageListener Interface 199

MDP Option 2:Using the SessionAwareMessageListener Interface 201

MDP Option 3:Using the MessageListenerAdapter 202

Message Conversion Limitations 207

The Spring JMS Namespace 208

<jms:listener-container>Element Properties 209

<jms:listener>Element Properties 211

10.Deployment Considerations 213

Performance,Scalability,and Reliability 213

Determining Message Throughput Requirements 213

Testing the Real-World Scenario 214

To Multicast or Not to Multicast 217

TCP/IP 218

UDP 218

IP Multicast 218

Messaging Over IP Multicast 219

The Bottom Line 221

Security 222

Authentication 222

Authorization 223

Secure Communication 224

Firewalls and HTTP Tunneling 224

Connecting to the Outside World 225

Bridging to Other Messaging Systems 227

11.Messaging Design Considerations 229

Internal Versus External Destination 229

Internal Destination Topology 230

External Destination Topology 231

Request/Reply Messaging Design 232

Messaging Design Anti-Patterns 236

Single-Purpose Queue 236

Message Priority Overuse 240

Message Header Misuse 240

A.The Java Message Service API 245

B.Message Headers 265

C.Message Properties 277

D.Installing and Configuring ActiveMQ 285

Index 291