SPECIAL OFFER
Use code BACKTOLEARN during checkout to save 50% on books, eBooks, & videos. Shop now.
Register your product to gain access to bonus material or receive a coupon.
The Server-side Java market has exploded and use of messaging as a means of integrating applications and processes is as strong, if not stronger, than ever. This book offers a customer-focused perspective on building messaging solutions based on JMS and the leading messaging provider, IBM WebSphere Application Server. The author, Kareem Yusuf, uses his real-world knowledge of JMS and open standards to teach the reader how to most effectively use JMS and IBM software to implement messaging solutions within the enterprise. Although the book is key of developers and technical architects working with IBM WebSphere, the book includes extensive generic examples and material that is not dependent on specific vendor's implementations. All code samples contained within the book will be available on the companion website.
Preface.
Acknowledgments.
I. ENTERPRISE MESSAGING AND JMS.
1. Enterprise Messaging.Defining Messaging. Messaging Architecture. Message Distribution Paradigms. Interaction Patterns. Connectivity Options. Summary.
2. Java Message Service.Key Concepts. Messaging Domains. What's New in JMS 1.1. JMS Messages. Application Server Facilities. Concurrent Processing of Incoming Messages. Distributed or Global Transactions. Summary.
3. JMS Messages.Message Definition. XML. Tagged/Delimited. Record-Oriented. JMS Message Structure. Message Header. Properties. Message Selectors. Message Body. Using the JMS Message Interface. Summary.
4. Using the JMS API.The JMS Client: Implementation Considerations. Point-to-Point Interface. Connecting to a Provider. Sending Messages. Receiving Messages. Additional Facilities. Publish-Subscribe Interface. Connecting to a Provider. Publishing Messages. Creating Subscribers. Additional Facilities. Handling JMS Exceptions. Handling Local Transactions. Unified Interface. Summary.
II. USING JMS WITH IBM WEBSPHERE.
5. IBM JMS Providers.The WebSphere Software Platform. WebSphere MQ. System Components. JMS Support. WebSphere MQ Everyplace. JMS Support. WebSphere Business Integration Message Broker. System Components. JMS Support. WebSphere Application Server. JMS Support. Summary.
6. IBM JMS--Administered Objects.Administered Objects Revisited. WebSphere JMS Provider (Embedded JMS Server). WebSphere QueueConnectionFactory. WebSphere TopicConnectionFactory. WebSphere Queue. WebSphere Topic. WebSphere MQ JMS Provider. MQQueueConnectionFactory. MQTopicConnectionFactory. MQXAQueueConnectionFactory and MQXATopicConnectionFactory. JMSWrapXAQueueConnectionFactory and JMSWrapXATopicConnectionFactory. WebSphere Application Server Runtime Properties. MQQueue. MQTopic. Creating Administered Objects. WebSphere Application Server Administration Console. JMSAdmin. Summary.
7. JMS Implementation Scenarios.Development Environment. Scenario 1: Exchanging Messages Using EJBs. Create the Sender Session Bean. Create the Message-Driven Bean. Test the Scenario Implementation. Scenario 2: Implementing Publish-Subscribe. Create the Publisher Session Bean. Create the Subscriber Message-Driven Beans. Test the Scenario Implementation. Scenario 3: Communicating with Non-JMS Clients. Using the WebSphere MQ JMS Provider. Testing the Scenario Implementation. Scenario 4: Securing JMS Communications. SSL Concepts. Configuring WebSphere MQ SSL. Testing the Scenario Implementation. Summary.
8. Enterprise Deployment.JMS Provider Location. Clustering Topologies. High-Availability Clusters. Workload Management Clusters. Message Broker Collectives and Clones. JNDI Namespace Provider. Summary.
Appendix A. JMS Specification Excerpts.Message Selector Syntax. JMS Standard Exceptions.
Appendix B. Implementing XA Global Transactions.Development Environment. Using XA Global Transactions. Create the Entity Bean. Create the Session Bean. Modify the MDB. Test the Scenario Implementation.
Appendix C. Implementing Publish-Subscribe II.Development Environment. Using Message Broker. Broker Configuration. Update Application Configuration. Test the Scenario Implementation.
Appendix D. Resources.
Then I first started working for IBM in 1998 as a software engineer, Java was still in its infancy and the development of messaging applications in Java was virtually nonexistent. I recall the first major customer I worked with, who was trying to use Java servlets to send messages via MQSeries (as it was then known) to a mainframe application (CICS). Comments like "Customers have started doing this?" were shared by teammates as we stepped up to address the issues at hand. Now Java has grown, server-side Java has exploded, and the use of messaging as a means of integrating applications and processes is as strong as, if not stronger than, ever. Alongside this growth has evolved the importance and benefit of open standards. In the Java world, J2EE adoption has become a given, and JMS as a standards-based API for messaging has become one of the most popular APIs in current use.
I still work with IBM customers, and they are my inspiration for writing this book. Over the years, I have handled numerous queries associated with how to use standards-based APIs such as JMS with IBM WebSphere software. These queries have run the gamut, ranging from architectural to implementation considerations. It is these answers, my thoughts and experience, that I share here.
The overall goal of this book is to serve as an authoritative guide to using JMS and IBM software to implement messaging solutions within the enterprise. It covers the role and use of messaging, explores JMS in great depth, and provides guidance on how to design, develop, and implement JMS-based solutions. It does this using a combination of discussions, code examples, and hands-on tutorials. My personal objective is to provide you, in a simple, clear, and concise manner, with a rich resource that serves not only as a learning aid, but also as a ready reference on the subject of enterprise messaging using JMS.
This book does not aim to be a product manual, and in all cases I discuss underlying product technology to a level of detail appropriate to understanding the subject under discussion. Consequently, this book is not (nor does it aim to be) an exhaustive reference on a given product set. Should you desire to explore certain technologies discussed in this book to a depth greater than what is offered here, you'll find a detailed resource list in Appendix D to guide and support further reading.
The primary audience for this book are developers and technical architects who are developing messaging infrastructure and are interested in using JMS, particularly with IBM WebSphere. While the book focuses on the JMS implementations offered by IBM WebSphere, it is still useful to those not using IBM software, as it includes extensive generic material that is not dependent on a specific vendor's implementation. The book is also useful for technical managers and students who need to gain a better understanding of JMS and enterprise messaging systems.
The book assumes some familiarity with programming languages in general and with Java in particular. While you do not need to be a seasoned programmer to appreciate and benefit from the book, you do need to be comfortable with Java concepts and to a lesser extent J2EE to follow the code examples and tutorials. The resources in Appendix D can provide you with more background in specific subject areas.
This book is split into two main parts: "Enterprise Messaging and JMS" and "Using JMS with IBM WebSphere." Part 1 (Chapters 1 to 4) discusses enterprise messaging and JMS from a generic perspective, focusing on patterns and utilization of the standards-based API. Part 2 (Chapters 5 to 8) introduces IBM JMS implementations and explores their use and configuration in support of JMS solutions. A set of appendices complete the book, providing reference information and extensions to tutorials.
Chapter 1, "Enterprise Messaging," defines messaging and explores how it is used within the enterprise. It examines enterprise messaging architecture, reviews associated paradigms, and discusses patterns governing how applications interact using messaging. It then explains how an application can utilize messaging infrastructure, which sets the stage for our examination of JMS as such an option for Java applications
Chapter 2, "Java Message Service," provides a technical overview of JMS, introducing key concepts and terminology. It reviews important aspects of the specification, such as messaging domains, JMS messages, and Application Server Facilities (ASF), and highlights what's new in the latest version of the specification. It thus forms the platform from which we delve deeper into JMS in following chapters.
Chapter 3, "JMS Messages," undertakes a detailed examination of the JMS message, which is the entity communicating applications exchange. It examines the concepts and considerations associated with creating a message, discussing how message content is defined and how physical formats are used to structure message content. It then reviews in detail the structure of the JMS message and considers the suitability of various message types for enterprise messaging applications. Finally, using code examples, it shows how the JMS message is manipulated by the application.
Chapter 4, "Using the JMS API," extends our discussion to the actual use of the JMS API. It starts by considering our implementation choices regarding the software component used to implement the messaging application: standalone application, Enterprise Java Bean, and so on. It provides a detailed review of the JMS API. Extensive use of code examples is employed to illustrate usage and implementation approaches, and by the end of this chapter you should be fairly comfortable with writing JMS applications.
Chapter 5, "IBM JMS Providers," switches our focus from the generic use of JMS to its use with specific implementations. To this end, Chapter 5 details and reviews IBM JMS implementations (called JMS providers) that provide the operating environment and messaging infrastructure for communicating JMS applications. It addresses the IBM software used to implement a JMS messaging solution and reviews a number of popular offerings in terms of their support for JMS, including WebSphere MQ and WebSphere Application Server.
The glue that binds a JMS application to a JMS provider is the administered object, and Chapter 6, "IBM JMS-Administered Objects," details the administered objects defined for two IBM JMS providers: the WebSphere JMS Provider embedded within the WebSphere Application Server and the WebSphere MQ JMS Provider, which comprises WebSphere MQ and WebSphere Business Integration Message Broker. We examine the properties exposed by these administered objects and how they influence the behavior of the JMS application. We also review IBM supplied tools for creating these objects.
Chapter 7, "JMS Implementation Scenarios," provides a number of hands-on tutorials that guide you through implementing some common JMS usage scenarios. It ties together the knowledge gained in the previous chapters and illustrates useful implementation approaches to real-world problems. The scenarios cover exchanging messages using Enterprise Java Beans, communicating with non-JMS applications, and securing JMS communications. By the end of this chapter you would have built a number of functional prototypes, rounding out the basic skills you acquired by end of Chapter 4.
The successful conclusion of any application development project is the operational deployment of the application. Chapter 8, "Enterprise Deployment," reviews a number of important considerations associated with deploying JMS applications in the enterprise. These include resource location and physical topologies for availability and workload management.
Appendix A, "JMS Specification Excerpts," reproduces specific sections of the JMS specification that are relevant to discussions in the book. They are reproduced strictly as a convenience.
Appendix B, "Implementing XA Global Transactions," extends one of the JMS implementation scenarios discussed in Chapter 7 to include message handling and database updates within a single global transaction
Appendix C, "Implementing Publish-Subscribe II," extends one of the JMS implementation scenarios discussed in Chapter 7 to include configuration of a different JMS provider.
Appendix D, "Resources," provides a detailed, annotated list of useful publications and reference sites that provide further insight into specific subject areas.
I generally recommend that this book be read in a linear fashion, as each chapter lays the foundation for the one that follows. That being said, there are no hard-order dependencies between chapters, and I have generally written in a style that accommodates readers who might want to read specific chapters. The one exception is the hands-on tutorials detailed in Appendix B and Appendix C, which are dependent upon completion of associated tutorials in Chapter 7. For clarity, I recommend that they only be attempted after you have familiarized yourself with the scenarios in Chapter 7.
If you are already familiar with messaging and JMS and are more interested in how to use IBM JMS implementations, you may choose to skim through Part 1 and focus on Part 2. However, note that both Chapter 3 and Chapter 4 in Part 1 contain discussions on design and usage considerations that might prove valuable even to a JMS expert.
This book covers two versions of the JMS specification: JMS 1.0.2b and JMS 1.1. Where appropriate, I distinguish between them; otherwise, I simply use the term JMS to refer to both versions.
While this book does offer code examples illustrating the use of the unified messaging domain introduced by JMS 1.1, it is important to note that at the time of this writing the JMS providers used in the hands-on tutorials support JMS 1.0.2b only. Thus, the functional prototypes developed are based on this version of the specification.