WebSphere Message Broker Basics

Transcription

Front coverWebSphere MessageBroker BasicsIntroduces WebSphere Message Broker V6Describes basic installation,configuration, and development tasksExplores the MessageBrokers ToolkitSaida DaviesLaura CowenCerys GiddingsHannah Parkeribm.com/redbooks

International Technical Support OrganizationWebSphere Message Broker BasicsDecember 2005SG24-7137-00

Note: Before using this information and the product it supports, read the information in“Notices” on page xv.First Edition (December 2005)This edition applies to:VersionReleaseModificationProduct nameProductNumberPlatform600WebSphere Message BrokerWindows5724-J05600WebSphere MQWindows5724-H72820DB2 UDB Enterprise Server EditionWindows5765-F41601IBM Rational Agent ControllerWindowsN/A Copyright International Business Machines Corporation 2005. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADPSchedule Contract with IBM Corp.

ContentsFigures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ixNotices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiThe team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiBecome a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxChapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 The scope of this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1.1 Intended audience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.2 Overview of the topics covered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.3 What is not covered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1.4 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Chapter 2. Product overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1 Application integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.1.1 Application integration and WebSphere Message Broker. . . . . . . . . . 82.2 WebSphere Message Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2.1 Editions of WebSphere Message Broker . . . . . . . . . . . . . . . . . . . . . . 92.2.2 Capabilities of WebSphere Message Broker . . . . . . . . . . . . . . . . . . 102.2.3 Components of WebSphere Message Broker. . . . . . . . . . . . . . . . . . 12Chapter 3. Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.1 Planning for installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.1.1 Required software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.1.2 Optional software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.1.3 Software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2 Security issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.1 User ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.2 Other security issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3 Installing the required software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.1 The Launchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.2 Installing with the Express Installation . . . . . . . . . . . . . . . . . . . . . . . 283.3.3 Installing with the Advanced Installation . . . . . . . . . . . . . . . . . . . . . . 303.4 Post installation tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.4.1 WebSphere MQ service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Copyright IBM Corp. 2005. All rights reserved.iii

3.4.2 DB2 Universal Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.4.3 Rational Agent Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.5 Verifying the installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.5.1 Creating the default configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.5.2 Running the Getting Started samples . . . . . . . . . . . . . . . . . . . . . . . . 383.6 Next steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.6.1 Navigating the Message Brokers Toolkit. . . . . . . . . . . . . . . . . . . . . . 403.7 Installing product fix packs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.7.1 Before you install a fix pack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.7.2 Installing a fix pack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.8 Updates to the Message Brokers Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . 44Chapter 4. Developing applications with ESQL . . . . . . . . . . . . . . . . . . . . . 474.1 Developing message flow applications with ESQL . . . . . . . . . . . . . . . . . . 484.1.1 Messages in WebSphere Message Broker . . . . . . . . . . . . . . . . . . . . 484.1.2 The Message Flow editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484.1.3 ESQL and the ESQL editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.1.4 Scenarios demonstrated in this chapter . . . . . . . . . . . . . . . . . . . . . . 514.1.5 Before you start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524.2 Developing the Simple message flow application . . . . . . . . . . . . . . . . . . . 524.2.1 Creating the ESQL Simple message flow . . . . . . . . . . . . . . . . . . . . 534.2.2 Configuring the ESQL Simple message flow . . . . . . . . . . . . . . . . . . 584.2.3 Writing ESQL for the Compute node. . . . . . . . . . . . . . . . . . . . . . . . . 654.2.4 Deploying and testing the ESQL Simple message flow . . . . . . . . . . 674.2.5 Diagnosing problems with the ESQL Simple message flow . . . . . . 784.3 Developing the Bookstore scenario using ESQL . . . . . . . . . . . . . . . . . . . 794.3.1 Creating the Bookstore scenario database . . . . . . . . . . . . . . . . . . . . 804.3.2 Creating the ESQL Create Customer Account message flow . . . . 804.3.3 Creating the ESQL Book Order message flow . . . . . . . . . . . . . . . . 854.3.4 Deploying and testing the ESQL Bookstore message flows . . . . . . . 934.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Chapter 5. Developing applications with Java . . . . . . . . . . . . . . . . . . . . . . 975.1 Developing message flow applications with Java . . . . . . . . . . . . . . . . . . . 985.1.1 Java and the Java editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985.1.2 Scenarios described in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . 995.1.3 Before you start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005.2 Developing the Simple message flow application . . . . . . . . . . . . . . . . . . 1015.2.1 Creating the Java Simple message flow . . . . . . . . . . . . . . . . . . . . 1015.2.2 Configuring the Java Simple message flow . . . . . . . . . . . . . . . . . . 1035.2.3 Writing Java for the Java Simple message flow. . . . . . . . . . . . . . . 1035.2.4 Deploying and testing the Java Simple message flow . . . . . . . . . . 1085.3 Developing the Bookstore scenario using Java . . . . . . . . . . . . . . . . . . . 110ivWebSphere Message Broker Basics

5.3.1 Creating the Java Create Customer Account message flow . . . . 1105.3.2 Creating the Java Book Order message flow . . . . . . . . . . . . . . . . 1185.3.3 Deploying and testing the Java Bookstore message flows . . . . . . . 1325.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Chapter 6. Developing applications with mappings . . . . . . . . . . . . . . . . 1356.1 Developing message flow applications with mappings . . . . . . . . . . . . . . 1366.1.1 Message sets and message definitions . . . . . . . . . . . . . . . . . . . . . 1366.1.2 Mapping and the Message Mapping editor . . . . . . . . . . . . . . . . . . . 1386.1.3 Scenarios described in this chapter . . . . . . . . . . . . . . . . . . . . . . . . 1396.1.4 Before you start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406.2 Developing the Simple message flow application . . . . . . . . . . . . . . . . . . 1416.2.1 Defining the message model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1416.2.2 Creating the Mapping Simple message flow . . . . . . . . . . . . . . . . . 1496.2.3 Configuring the Mapping Simple message flow . . . . . . . . . . . . . . . 1516.2.4 Creating the mappings for the Mapping Simple message flow . . . 1536.2.5 Deploying and testing the Mapping Simple message flow . . . . . . . 1586.3 Developing the Bookstore scenario with mappings. . . . . . . . . . . . . . . . . 1606.3.1 Defining the message model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1616.3.2 Creating the Create Customer Account message flow . . . . . . . . . 1816.3.3 Creating the Mapping Book Order message flow . . . . . . . . . . . . . 1896.3.4 Deploying and testing the Mapping Bookstore message flows . . . . 2026.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203Chapter 7. Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2057.1 WebSphere Message Broker administration . . . . . . . . . . . . . . . . . . . . . . 2067.2 Creating a broker domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2067.2.1 Resources required for a simple broker domain . . . . . . . . . . . . . . . 2077.3 Steps for manually creating a simple broker domain . . . . . . . . . . . . . . . 2077.3.1 WebSphere MQ resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2077.4 Extending a broker domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2227.4.1 Adding a remote broker to the domain . . . . . . . . . . . . . . . . . . . . . . 2227.4.2 Deploying resources to a remote broker . . . . . . . . . . . . . . . . . . . . . 2267.4.3 Creating a User Name Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2267.5 Deploying message flow applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 2267.5.1 Creating a message broker archive . . . . . . . . . . . . . . . . . . . . . . . . 2277.5.2 Message flow application resource versioning . . . . . . . . . . . . . . . . 2327.6 Publish/subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2357.6.1 Publish/subscribe basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 2367.6.2 Broker topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2367.6.3 Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387.6.4 Subscriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239Chapter 8. Troubleshooting and problem determination. . . . . . . . . . . . . 241Contentsv

8.1 Locating error information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2428.1.1 Event messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2428.1.2 Messages within the Message Brokers Toolkit . . . . . . . . . . . . . . . . 2448.1.3 Message Brokers Toolkit Event Log . . . . . . . . . . . . . . . . . . . . . . . . 2508.1.4 Messages on the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . 2528.1.5 Windows Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2538.1.6 Locating more information about event messages . . . . . . . . . . . . . 2608.1.7 Other useful logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2628.2 Using the message Flow Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2648.2.1 Adding breakpoints to a message flow . . . . . . . . . . . . . . . . . . . . . . 2658.2.2 Attaching the Flow Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2668.2.3 Tracking a message through a flow . . . . . . . . . . . . . . . . . . . . . . . . 2688.2.4 Stepping through ESQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2708.2.5 Stepping through mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2718.2.6 Debugging Java code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2738.2.7 Flow of errors in a message flow . . . . . . . . . . . . . . . . . . . . . . . . . . 2768.2.8 Disconnecting the debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2778.3 Using trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2788.3.1 Tracing execution groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2788.3.2 Tracing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2858.3.3 Tracing commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2868.3.4 Tracing the Message Brokers Toolkit . . . . . . . . . . . . . . . . . . . . . . . 2878.3.5 WebSphere MQ trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2888.3.6 ODBC trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2898.4 Troubleshooting common problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2918.4.1 Default Configuration wizard problems . . . . . . . . . . . . . . . . . . . . . . 2918.4.2 Errors with the Message Brokers Toolkit . . . . . . . . . . . . . . . . . . . . 2938.4.3 Problems connecting to the Configuration Manager . . . . . . . . . . . . 2968.4.4 Problems with deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2998.4.5 Messages stuck on the input queue . . . . . . . . . . . . . . . . . . . . . . . . 3028.4.6 Common DB2 Universal Database Errors . . . . . . . . . . . . . . . . . . . 3028.4.7 Further information for troubleshooting . . . . . . . . . . . . . . . . . . . . . . 304Appendix A. Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307Message Brokers Toolkit help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Getting context-sensitive help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Using the product documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Viewing the product documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309Structure and content of the product documentation . . . . . . . . . . . . . . . . 309Finding information in the product documentation . . . . . . . . . . . . . . . . . . . . . 310Searching for information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311Diagnostic messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313Using the Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313viWebSphere Message Broker Basics

Orienting yourself in the help system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314Updating the product documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315Receiving automatic updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315Receiving manual updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315Updating the documentation in information centers . . . . . . . . . . . . . . . . . 316Getting help from other sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316Serving an information center from a single location . . . . . . . . . . . . . . . . . . . 316Useful links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317Appendix B. Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320Using the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320How to use the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323Abbreviations and acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Contentsvii

viiiWebSphere Message Broker Basics

54-164-174-184-194-204-214-224-234-244-25File download warning dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29The Launchpad during an Express Installation . . . . . . . . . . . . . . . . . . . 30Location of the Message Brokers Toolkit java.exe file . . . . . . . . . . . . . . 32System tray icons shows started and stopped state of WebSphere MQ 34System tray icons showing the started and stopped states of DB2 . . . . 35Part of Services window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Getting Started icon on Message Brokers Toolkit Welcome page. . . . . 36The Default Configuration wizard icon in the Message Brokers Toolkit. 37Sample icon from the Getting Started page . . . . . . . . . . . . . . . . . . . . . . 39Broker Application Development perspective . . . . . . . . . . . . . . . . . . . . 41The perspectives buttons in the Message Brokers Toolkit . . . . . . . . . . 42Installing Message Brokers Toolkit updates . . . . . . . . . . . . . . . . . . . . . 45Find and Install. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46The Message Flow editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Opening the node palette. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49The ESQL editor with code assist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Creating the ESQL Simple message flow . . . . . . . . . . . . . . . . . . . . . . . 54The

WebSphere Message Broker Basics December 2005 International Technical Support Organization SG24-7137-00