8/3/2019 Publish-Subscribe Developer's Guide 7.1
1/236
Developer Version 7.1 Publish-Subscribe Developer s Guide
ePage
8/3/2019 Publish-Subscribe Developer's Guide 7.1
2/236
Cerebra,Glue,InfravioXBroker,InfravioXRegistry,Infravio,MywebMethodsServer,MywebMethods,webMethodsAccess,webMethodsAdministratowebMethodsBroker,webMethodsCentralConfiguration,webMethodsDashboard,webMethodsDesigner,webMethodsDeveloper,webMethodsFabric,webMethodsGlue,webMethodsInfrastructureDataCollector,webMethodsInfravioXBroker,webMethodsInfravioXRegistry,webMethodsInstaller,webMethodsIntegrationServer,webMethodslogo,webMethodsMainframe,webMethodsManager,webMethodsModeler,webMethodsMonitor,webMethodsOptimizeforInfrastructure,webMethodsOptimizeforProcess,webMethodsOptimize,webMethodsPortal,webMethodsProcessEngine,webMethodsServicenet,webMethodsTaskEngine,webMethodsTradingNetworks,webMethodsWorkflow,andwebMethodsareeitherregisteredtrademarksortrademarksofwebMethods,Inc.
Acrobat,Acrobat,andReaderareregisteredtrademarksofAdobeSystemsIncorporated. AmdocsandClarifyCRMareregisteredtrademarksofAmdocs.AribaisaregisteredtrademarkofAriba,Inc. BEA,BEAWebLogicServer,Jolt,andTuxedoareregisteredtrademarks,andBEAWebLogicPlatformisatrademarkofBEASystems,Inc. ActionRequestSystem,BMCSoftware,PATROL,andRemedyareregisteredtrademarksofBMCSoftware,Inc. BroadVisiisaregisteredtrademarkofBroadVision,Inc. ChemeStandardsandCIDXaretrademarksofCIDX,TheChemicalIndustryDataExchange. SiteMinderanUnicenterareregisteredtrademarksofCA,Inc. PopChartisaregisteredtrademarkofCORDATechnologies,Inc. KenanandArborareregisteredtrademarofAlcatelLucent. DataConnectionandSNAPIXareregisteredtrademarksofDataConnectionCorporation. D&BandDUNSareregisteredtrademarksDun&BradstreetCorporation. EclipseisatrademarkofEclipseFoundation,Inc. EntrustisaregisteredtrademarkofEntrust,Inc. papiNetisaregisteredtrademarkoftheEuropeanUnionandtheUnitedStates. FinancialInformationeXchange,F.I.X,andF.I.XProtocolaretrademarksofFIXProtocolLtd.UCCnetandeBusinessReadyareregisteredtrademarks,and1SYNCandTransoraaretrademarksofGS1US. HewlettPackard,HP,HPUX,OpenView,PARISC,andSNAplus2aretrademarksofHewlettPackardCompany. i2isaregisteredtrademarkofi2Technologies,Inc. AIX,AS/400,CICS,ClearCase,DBDomino,IBM,Informix,Infoprint,Lotus,LotusNotes,MQSeries,OS/390,OS/400,RACF,RS/6000,SQL/400,S/390,System/390,VTAM,andWebSphere,anz/OSareregisteredtrademarks;andCommunicationsSystemforWindowsNT,DB2UniversalDatabase,IMS,MVS,andSQL/DSaretrademarksofIBMCorporation. InnoDBisatrademarkofInnobaseOy. ItaniumisaregisteredtrademarkofIntelCorporation. LinuxisaregisteredtrademarkofLinusTorvalds. W3Cisaregisteredtrademark,andXWindowSystemisatrademarkoftheMassachusettsInstituteofTechnology. MetaSolvisaregistered
trademarkof
Metasolv
Software,
Inc.
ActiveX,
Microsoft,
Outlook,
Visual
Basic,
Visual
SourceSafe,
Windows,
Windows
NT,
and
Windows
Server
are
registeredtrademarksofMicrosoftCorporation. SixSigmaisaregisteredtrademarkofMotorola,Inc. FirefoxandMozillaareregisteredtrademarksofthMozillaFoundation. MySQLisaregisteredtrademarkofMySQLAB. nCipherisatrademarkofnCipherCorporationLtd. EclipseisatrademarkofEclipFoundation,Inc. EntrustisaregisteredtrademarkofEntrust,Inc. papiNetisaregisteredtrademarkoftheEuropeanUnionandtheUnitedStates. FinancInformationeXchange,F.I.X,andF.I.XProtocolaretrademarksofFIXProtocolLtd. UCCnetandeBusinessReadyareregisteredtrademarks,and1SYNCanTransoraaretrademarksofGS1US. HewlettPackard,HP,HPUX,OpenView,PARISC,andSNAplus2aretrademarksofHewlettPackardCompany. i2iregisteredtrademarkofi2Technologies,Inc. AIX,AS/400,CICS,ClearCase,DB2,Domino,IBM,Informix,Infoprint,Lotus,LotusNotes,MQSeries,OS/390OS/400,RACF,RS/6000,SQL/400,S/390,System/390,VTAM,andWebSphere,andz/OSareregisteredtrademarks;andCommunicationsSystemforWindowNT,DB2UniversalDatabase,IMS,MVS,andSQL/DSaretrademarksofIBMCorporation. InnoDBisatrademarkofInnobaseOy. ItaniumisaregisteredtrademarkofIntelCorporation. TeradataisaregisteredtrademarkofNCRCorporation.NetscapeisaregisteredtrademarkofNetscapeCommunicationsCorporation. ServletExecisaregisteredtrademark,andNewAtlantaisatrademarkofNewAtlantaCommunications,LLC. SUSEisaregisteredtrademaofNovell,Inc. AppiaisaregisteredtrademarkandJavelinTechnologiesisatrademarkofNYFIX,Inc. CORBAisaregisteredtrademarkofObjectManagementGroup,Inc.JDEdwards,OneWorld,Oracle,PeopleSoft,Siebel,andVantiveareregisteredtrademarks;andInfranet,PeopleSoftPureInterneArchitecture,Portal,andWorldSoftwarearetrademarksofOracleCorporation. PerforceisatrademarkofPerforceSoftware.JBossandRedHatareregisteredtrademarksofRedHat,Inc. PIPandRosettaNetaretrademarksofRosettaNet,anonprofitorganization. SAPandR/3areregisteredtrademarofSAPAG. PVCSisaregisteredtrademarkofSerenaSoftware,Inc. SWIFTandSWIFTNetareregisteredtrademarksofSocietyforWorldwideInterbankFinancialTelecommunicationSCRL. SPARCandSPARCStationareregisteredtrademarksofSPARCInternational,Inc. BAANandSSAareregisteredtrademarks;andSSAGlobalisatrademarkofSSAGlobalTechnologies,Inc. EJB,EnterpriseJavaBeans,Java,JavaServer,JDBC,JSP,J2EE,Solaris,Sun,and
SunMicrosystemsareregisteredtrademarks;andJavaNamingandDirectoryInterface,JavaServerPages,SOAPwithAttachmentsAPIforJava,andSunSaretrademarksofSunMicrosystems,Inc. SybaseisaregisteredtrademarkofSybase,Inc. VERITASisaregisteredtrademark,andVERITASClusterServeratrademarkofSymantecCorporation. UNIXisaregisteredtrademarkofTheOpenGroup. UnicodeisatrademarkofUnicode,Inc. VeriSignisaregistertrademarkofVerisign,Inc.
SoftwareAGandallSoftwareAGproductnamesareeithertrademarksorregisteredtrademarksofSoftwareAG.
Otherproductandcompanynamesmentionedhereinmaybethetrademarksoftheirrespectiveowners.
Copyright2007webMethods,Inc.Allrightsreserved.
Copyright2007SoftwareAGand/oritssuppliers,Uhlandstrasse12,64297Darmstadt,Germany.Allrightsreserved.
Document ID: DEV-PS-DG-71-20070831
yrightDocu
ntID
8/3/2019 Publish-Subscribe Developer's Guide 7.1
3/236
Conten
Publish-Subscribe Developers Guide Version 7.1
C o n t e n t s
About th is Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 1. An Introduction to the Publish-and-Subscribe Model . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is the Publish-and-Subscribe Model? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
webMethods Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Basic Elements in the Publish-and-Subscribe Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Triggers (Broker/Local Triggers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Canonical Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 2. An Overview of the Publish and Subscribe Paths . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of the Publishing Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing Documents to the Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Publishing Documents When the Broker Is Not Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing Documents and Waiting for a Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of the Subscribe Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Subscribe Path for Published Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Subscribe Path for Delivered Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of Local Publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 3. Steps for Building a Publish-and-Subscribe Solution . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 1: Research the Integration Problem and Determine Solution . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 2: Determine the Production Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Step 3: Create the Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 4: Make the Publishable Document Types Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 5: Create the Services that Publish the Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 6: Create the Services that Process the Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8/3/2019 Publish-Subscribe Developer's Guide 7.1
4/236
Conten
Publish-Subscribe Developers Guide Version 7.1
Step 7: Define the Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 8: Synchronize the Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 4. Configuring the Integration Server to Publish and Subscribe to Documents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configure the Connection to the Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Document Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying a User Account for Invoking Services Specified in Triggers . . . . . . . . . . . . . . . . . . . . . . .
Configuring Server Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Settings for a Document History Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Integration Server for Key Cross-Reference and Echo Suppression . . . . . . . . . . . . . . . .
Configuring Integration Server to Handle Native Broker Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 5. Working with Publ ishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Making an Existing IS Document Type Publishable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Publishable Document Type from a Broker Document Type . . . . . . . . . . . . . . . . . . .
About the Associated Broker Document Type Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Envelope Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About Adapter Notifications and Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Publication Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting a Document Storage Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Document Storage Versus Client Queue Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Time-to-Live for a Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying Validation for a Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Modifying Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Important Considerations when Editing Publishable Document Types . . . . . . . . . . . . . . . . . . . .
Renaming a Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Making a Publishable Document Type Unpublishable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizing Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronization Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronization Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining Synchronization Action with Synchronization Status . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizing One Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizing Multiple Document Types Simultaneously . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizing Document Types in a Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizing Document Types Across a Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8/3/2019 Publish-Subscribe Developer's Guide 7.1
5/236
Conten
Publish-Subscribe Developers Guide Version 7.1
Importing and Overwriting References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Happens When You Overwrite Elements on the Integration Server? . . . . . . . . . . . . . . . .
What Happens if You Do Not Overwrite Elements on the Integration Server? . . . . . . . . . . . . . .
Testing Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 6. Publishing Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Publishing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Fields in the Document Envelope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Activation ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How to Publish a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing a Document and Waiting for a Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How to Publish a Request Document and Wait for a Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Delivering a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
How to Deliver a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Cluster Failover and Document Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Delivering a Document and Waiting for a Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
How to Deliver a Document and Wait for a Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Replying to a Published or Delivered Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Specifying the Envelope of the Received Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
How to Create a Service that Sends a Reply Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 7. Working with Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of Building a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Service Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Trigger Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Creating a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Creating a Filter for a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Filter Evaluation at Design Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Filters and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Creating a Filter for a Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Using Multiple Conditions in a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Using Multiple Conditions for Ordered Service Execution . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Adding Conditions to a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Ordering Conditions in a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Setting Trigger Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Disabling and Enabling a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Disabling and Enabling Triggers in a Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
8/3/2019 Publish-Subscribe Developer's Guide 7.1
6/236
Conten
Publish-Subscribe Developers Guide Version 7.1
Setting a Join Time-out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Join Time-outs for All (AND) Join Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Join Time-outs for Only One (XOR) Join Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Setting a Join Time-out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Specifying Trigger Queue Capacity and Refill Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Controlling Document Acknowledgements for a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Selecting Messaging Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Serial Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Serial Processing in Clustered Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Concurrent Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Selecting Document Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Changing Document Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configuring Fatal Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configuring Transient Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configuring Retry Behavior for Trigger Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Service Requirements for Retrying a Trigger Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Handling Retry Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of Throw Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of Suspend and Retry Later . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configuring Transient Error Handling Properties for a Trigger . . . . . . . . . . . . . . . . . . . . . . 1
Trigger Service Retries and Shutdown Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Modifying a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Deleting Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Deleting Triggers in a Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Testing Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Testing Join Conditions from Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 8. Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Is Document Processing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Redelivery Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Document History Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Happens When the Document History Database Is Not Available? . . . . . . . . . . . . . 1
Documents without UUIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Managing the Size of the Document History Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Document Resolver Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Document Resolver Service and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Extenuating Circumstances for Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
8/3/2019 Publish-Subscribe Developer's Guide 7.1
7/236
Conten
Publish-Subscribe Developers Guide Version 7.1
Exactly-Once Processing and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configuring Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Disabling Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Building a Document Resolver Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Viewing Exactly-Once Processing Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 9. Understanding Join Condi tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Join Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Subscribe Path for Documents that Satisfy a Join Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The Subscribe Path for Documents that Satisfy an All (AND) Join Condition . . . . . . . . . . . . . . . 1
The Subscribe Path for Documents that Satisfy an Only one (XOR) Join Condition . . . . . . . . . 1
Join Conditions in Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 10. Synchronizing Data Between Multiple Resources . . . . . . . . . . . . . . . . . . . . . . 1
Data Synchronization Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Data Synchronization with webMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Equivalent Data and Native IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Canonical Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Structure of Canonical Documents and Canonical IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Key Cross-Referencing and the Cross-Reference Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
How the Cross-Reference Table Is Used for Key Cross-Referencing . . . . . . . . . . . . . . . . . 1
Echo Suppression for N-Way Synchronizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
How the isLatchedClosed Field Is Used for Echo Suppression . . . . . . . . . . . . . . . . . . . . . 1
Tasks to Perform to Set Up Data Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Preparing the Cross-Reference Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Defining How a Source Resource Sends Notification of a Data Change . . . . . . . . . . . . . . . . . . . . . . 1
When Using an Adapter with the Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
When Developing Your Own Interaction with the Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Defining the Structure of the Canonical Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Setting Up Key Cross-Referencing in the Source Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . 2
Built-In Services for Key Cross-Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Setting up the Source Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Setting Up Key Cross-Referencing in the Target Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . . 2
For N-Way Synchronizations Add Echo Suppression to Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Built-in Services for Echo Suppression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Adding Echo Suppression to Notification Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Incorporating Echo Suppression Logic into a Notification Service . . . . . . . . . . . . . . . . . . . 2
Adding Echo Suppression to Update Trigger Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Incorporating Echo Suppression Logic into an Update Service . . . . . . . . . . . . . . . . . . . . . 2
8/3/2019 Publish-Subscribe Developer's Guide 7.1
8/236
Conten
Publish-Subscribe Developers Guide Version 7.1
Appendix A. Naming Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Naming Rules for webMethods Developer Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Naming Rules for webMethods Broker Document Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Append ix B. Bui lding a Resource Monitoring Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Service Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
8/3/2019 Publish-Subscribe Developer's Guide 7.1
9/236
About this Bo
Publish-Subscribe Developers Guide Version 7.1
A b o u t t h i s B o o k
webMethodsDeveloperprovidestoolstointegrateresources.ItenablesuserstobuildintegrationsolutionslocallywithinonewebMethodsIntegrationServeroracrossmultipIntegrationServersallexchanginginformationviaaBroker.Thisguideisfordeveloperandadministratorswhowanttomakeuseofthiscapability.
D o c u m en t C o n v en t i o n s
Note: WithwebMethodsDeveloper,youcancreateBroker/localtriggersandJMStriggerABroker/localtriggeristriggerthatsubscribestoandprocessesdocumentspublished/deliveredlocallyortotheBroker.AJMStriggerisatriggerthatreceivesmessagesfromadestination(queueortopic)onaJMSproviderandthenprocessesthosmessages.ThisguidediscussesdevelopmentanduseofBroker/localtriggersonly.Wherthetermtriggersappearsinthisguide,itreferstoBroker/localtriggers.ForinformationaboutcreatingJMStriggers,seethewebMethodsIntegrationServerJMSClientDevelopersGuide.
Convention Description
Bold Identifieselementsonascreen.
Italic Identifiesvariableinformationthatyoumustsupplyorchangebasedonyourspecificsituationorenvironment.Identifiestermsthe
firsttimetheyaredefinedintext.Alsoidentifiesserviceinputandoutputvariables.
Narrow font IdentifiesstoragelocationsforservicesonthewebMethodsIntegrationServerusingtheconventionfolder.subfolder:service.
Typewriter
font
Identifiescharactersandvaluesthatyoumusttypeexactlyormessagesthatthesystemdisplaysontheconsole.
UPPERCASE Identifieskeyboardkeys.Keysthatyoumustpresssimultaneouslyarejoinedwiththe+symbol.
\ Directorypathsusethe\directorydelimiterunlessthesubjectisUNIXspecific.
[] Optionalkeywordsorvaluesareenclosedin[].Donottypethe[]symbolsinyourowncode.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
10/236
About this Boo
Publish-Subscribe Developers Guide Version 7.1
A d d i t i o n a l I n f o r m a t i o n
ThewebMethodsAdvantageWebsiteathttp://advantage.webmethods.comprovidesyowithimportantsourcesofinformationaboutwebMethodsproducts:
Troubleshooting Information.ThewebMethodsKnowledgeBaseprovidestroubleshootinginformationformanywebMethodsproducts.
Documentation Feedback.ToprovidefeedbackonwebMethodsdocumentation,gototheDocumentationFeedbackFormonthewebMethodsBookshelf.
Additional Documentation. Startingwith7.0,youhavetheoptionofdownloadingthedocumentationduringproductinstallationtoasingledirectorycalled_documentation,locatedbydefaultunderwebMethodsinstallationdirectory.Inaddition,youcanfinddocumentationforallwebMethodsproductsonthewebMethodsBookshelf.
http://advantage.webmethods.com/http://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/Bookshelfhttp://advantage.webmethods.com/docfeedbackhttp://advantage.webmethods.com/8/3/2019 Publish-Subscribe Developer's Guide 7.1
11/236
Publish-Subscribe Developers Guide Version 7.1
Ch ap t er 1. A n In t r o du c t i on t o t h e Pu b l i sh -an d -Su b s cr i b eMode l
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
What Is the Publish-and-Subscribe Model? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
webMethods Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Basic Elements in the Publish-and-Subscribe Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8/3/2019 Publish-Subscribe Developer's Guide 7.1
12/236
1. An Introducti on to the Publish -and-Subscribe Mod
Publish-Subscribe Developers Guide Version 7.1
I n t r o d u c t i o n
Companiestodayaretaskedwithimplementingsolutionsformanytypesofintegrationchallengeswithintheenterprise.Manyofthesechallengesrevolvearoundapplication
integration
(between
software
applications
and
other
systems)
and
fall
into
common
patterns,suchas
Propagation. Propagationofsimilarbusinessobjectsfromonesystemtomultipleothesystems,forexample,anorderstatuschangeoraproductpricechange.
Synchronization.Synchronizationofsimilarbusinessobjectsbetweentwoormoresystemstoobtainasingleview,forexample,realtimesynchronizationofcustomer,productregistration,productorder,andproductSKUinformationamongseveralapplications.Thisisthemostcommonissuerequiringanintegrationsolution.
Inaonewaysynchronization,thereisonesystem(resource)thatactsasadatasourceandoneormoreresourcesthataretargetsofthesynchronization.
Inatwowaysynchronization,everyresourceisbothapotentialsourceandtargofasynchronization.Thereisnotasingleresourcethatactsastheprimarydataresource.Achangetoanyresourceshouldbereflectedinallotherresources.Thiscalledatwowaysynchronization.
Aggregation.Informationjoinedfrommultiplesourcesintoacommondestinationsystem,forexample,communicatingpharmacycustomerrecordsandprescriptiontransactionsandWebsitedataintoacentralapplicationanddatabase.
ThewebMethodsproductsuiteprovidestoolsthatyoucanusetodesignanddeploysolutionsthataddressthesechallengesusingapublishandsubscribemodel.
W h at I s t h e P u b l i s h - a n d - Su b s c r i b e Mo d e l ?
Thepublishandsubscribemodelisaspecifictypeofmessagebasedsolutioninwhichmessagesareexchangedanonymouslythroughamessagebroker.Applicationsthatproduceinformationthatneedstobesharedwillmakethisinformationavailableinspecifictypesofrecognizabledocumentsthattheypublishtothemessagebroker.Applicationsthatrequireinformationsubscribetothedocumenttypestheyneed.
Atruntime,themessagebrokerreceivesdocumentsfrompublishersandthendistributethedocumentstosubscribers.Thesubscribingapplicationprocessesorperformsworkusingthedocumentandmayormaynotsendaresponsetothepublishingapplication.
InawebMethods
system,
the
webMethods
Integration
Server
or
applications
running
othewebMethodsIntegrationServerpublishdocumentstotheBroker.TheBrokerthen
routesthedocumentstosubscriberslocatedonotherIntegrationServers.Thefollowingsectionsprovidemoredetailaboutthesecomponents.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
13/236
1. An Introducti on to the Publish -and-Subscribe Mod
Publish-Subscribe Developers Guide Version 7.1
w e b M e t h o d s C o m p o n e n t s
TheIntegrationServerandtheBrokershareafast,efficientprocessforexchangingdocumentsacrosstheentirewebMethodssystem.
I n teg ra t i on Serve r TheIntegrationServeristhesystemscentralruntimecomponent.Itservesastheentrypointforthesystemsandapplicationsthatyouwanttointegrate,andisthesystemsprimaryenginefortheexecutionofintegrationlogic.Italsoprovidestheunderlyinghandlersandfacilitiesthatmanagetheorderlyprocessingofinformationfromresourceinsideandoutsidetheenterprise.TheIntegrationServerpublishesdocumentstoandreceivesdocumentsfromtheBroker.FormoreinformationabouttheIntegrationServerseethewebMethodsIntegrationServerAdministratorsGuide.
B r o k e r
TheBroker
forms
the
globally
scalable
messaging
backbone
of
webMethods
component
Itprovidestheinfrastructureforimplementingasynchronous,messagebasedsolutionsthatarebuiltonthepublishandsubscribemodeloroneofitsvariants,request/replyorpublishandwait.
Integration Server Cluster
Resource
Resource
Resources
BrokerIntegrationServer
IntegrationServer
Adapters
8/3/2019 Publish-Subscribe Developer's Guide 7.1
14/236
1. An Introducti on to the Publish -and-Subscribe Mod
Publish-Subscribe Developers Guide Version 7.1
TheroleoftheBrokeristoroutedocumentsbetweeninformationproducers(publishersandinformationconsumers(subscribers).TheBrokerreceives,queues,anddeliversdocuments.
TheBrokermaintainsaregistryofdocumenttypesthatitrecognizes.Italsomaintainsa
listof
subscribers
that
are
interested
in
receiving
those
types
of
documents.
When
the
Brokerreceivesapublisheddocument,itqueuesitforthesubscribersofthatdocumenttype.Subscribersretrievedocumentsfromtheirqueues.Thisactionusuallytriggersanactivityonthesubscriberssystemthatprocessesthedocument.
AwebMethodssystemcancontainmultipleBrokers.Brokerscanoperateingroups,calledterritories,whichallowseveralBrokerstosharedocumenttypeandsubscriptioninformation.ForadditionalinformationaboutBrokers,seethewebMethodsBrokerAdministratorsGuide.
FormoreinformationabouthowdocumentsflowbetweentheIntegrationServerandthBroker,seeChapter 2,AnOverviewofthePublishandSubscribePaths.
B a s i c E l e m en t s i n t h e P u b l i s h - a n d - Su b s c r i b e Mo d e l
Thefollowingsectionsdescribethebasicbuildingblocksofanintegrationsolutionthatusesthepublishandsubscribemodel.
D o c u m e n t s
Inanintegrationsolutionbuiltonthepublishandsubscribemodel,applicationspublisandsubscribetodocuments.DocumentsareobjectsthatwebMethodscomponentsusetoencapsulateandexchangedata.AdocumentrepresentsthebodyofdatathataresourcepassestowebMethodscomponents.Oftenitrepresentsabusinesseventsuchasplacinganorder(purchaseorderdocument),shippinggoods(shippingnotice),oraddinganewemployee(newemployeerecord).
Eachpublisheddocumentincludesanenvelope.Theenvelopeismuchlikeaheaderinaemailmessage.Theenveloperecordsinformationsuchasthesendersaddress,thetimethedocumentwassent,sequencenumbers,andotherusefulinformationforroutingandcontrol.ItcontainsinformationaboutthedocumentanditstransitthroughyourwebMethodssystem.
Pub l i s hab le Documen t Types
Every
published
document
is
associated
with
a
publishable
document
type.
A
publishabldocumenttypeisanamedschemalikedefinitionthatdescribesthestructureofaparticulakindofdocumentthatcanbepublishedandsubscribedto.AninstanceofapublishabledocumenttypecaneitherbepublishedlocallywithinanIntegrationServer,orcanbepublishedtoaBroker.InapublicationenvironmentthatincludesaBroker,eachpublishabledocumenttypeisboundtoaBrokerdocumenttype.ClientsontheBroker
8/3/2019 Publish-Subscribe Developer's Guide 7.1
15/236
1. An Introducti on to the Publish -and-Subscribe Mod
Publish-Subscribe Developers Guide Version 7.1
subscribetopublishabledocumenttypes.TheBrokerusespublishabledocumenttypestdeterminewhichclientstodistributedocumentsto.
Formoreinformationaboutpublishabledocumenttypes,seeChapter 5,WorkingwithPublishableDocumentTypes.
Tr igg e rs (B roke r /Loca l Tr i gg e rs )
Trigger,specificallyBroker/localtriggersestablishsubscriptionstopublishabledocumentypes.Triggersalsospecifytheservicesthatwillprocessdocumentsreceivedbythesubscription.Withinatrigger,aconditionassociatesoneormorepublishabledocumenttypeswithaservice.
Formoreinformationabouttriggers,seeChapter 7,WorkingwithTriggers.
Serv i ces
Servicesaremethodlikeunitsofwork.TheycontainlogicthattheIntegrationServerexecutes.Youbuildservicestocarryoutworksuchasextractingdatafromdocuments,interactingwithbackendresources,andpublishingdocumentstotheBroker.Whenyo
buildatrigger,youspecifytheservicethatyouwanttousetoprocessthedocumentsthayousubscribeto.
Formoreinformationaboutbuildingservices,seethewebMethodsDeveloperUsersGuide
Adap te r No t i f i ca t i on s
AdapternotificationsnotifyyourwebMethodssystemwheneveraspecificeventoccursoanadaptersresource.Theadapternotificationpublishesadocumentwhenthespecifiedeventoccursontheresource.Forexample,ifyouareusingtheJDBCAdapterandachangeoccursinadatabasetablethatanadapternotificationismonitoring,theadapternotificationpublishesadocumentcontainingdatafromtheeventandsendsittotheIntegrationServer.Eachadapternotificationhasanassociatedpublishabledocumenttype.TheIntegrationServerassignsthisdocumenttypethesamenameastheadapternotificationbutappendsPublishDocumenttothename.
Youcanusetriggerstosubscribetothepublishabledocumenttypesassociatedwithadapternotifications.Theserviceassociatedwiththepublishabledocumenttypeinthetriggerconditionmightperformsomeadditionalprocessing,updating,orsynchronizationbasedonthecontentsoftheadapternotification.
Note: WithwebMethodsDeveloper,youcancreateBroker/localtriggersandJMStriggerThisguidediscussesdevelopmentanduseofBroker/localtriggersonly.Wheretheterm
triggerortriggersappearinthisguide,theyrefertoBroker/localtriggers.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
16/236
1. An Introducti on to the Publish -and-Subscribe Mod
Publish-Subscribe Developers Guide Version 7.1
Canon i ca l Docum en ts
AcanonicaldocumentisastandardizedrepresentationthatadocumentmightassumewhileitispassingthroughyourwebMethodssystem.Acanonicaldocumentactsastheintermediarydataformatbetweenresources.
Forexample,inanimplementationthatacceptspurchaseordersfromcompanies,oneothestepsintheprocessconvertsthepurchaseorderdocumenttoacompanysstandardpurchaseorderformat.Thisformatiscalledthe canonical formofthepurchaseorderdocument.Thecanonicaldocumentispublished,delivered,andpassedtoservicesthatprocesspurchaseorders.
Byconvertingadocumenttoaneutralintermediateformat,subscribers(suchasadapteservices)onlyneedtoknowhowtoconvertthecanonicaldocumenttotherequiredapplicationformat.Ifcanonicaldocumentswerenotused,everysubscriberwouldhavet
beabletodecodethenativedocumentformatofeverypublisher.
Acanonicaldocumentisapublishabledocumenttype.Thecanonicaldocumentisused
whenbuilding
publishing
services
and
subscribed
to
when
building
triggers.
In
flow
services,youcanmapdocumentsfromthenativeformatofanapplicationtothecanonicalformat.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
17/236
Publish-Subscribe Developers Guide Version 7.1
Ch ap t er 2. A n Ov er v i ew o f t h e Pu b l i sh a nd S ub s c r ib e Pat h s
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Overview of the Publishing Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Overview of the Subscribe Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Overview of Local Publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8/3/2019 Publish-Subscribe Developer's Guide 7.1
18/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
I n t r o d u c t i o n
InthewebMethodssystem,IntegrationServersexchangedocumentsviapublicationansubscription.OneIntegrationServerpublishesadocumentandoneormoreIntegration
Servers
subscribe
to
and
process
that
document.ThischapterprovidesoverviewsofhowtheIntegrationServerinteractswiththeBrokertopublishandsubscribetodocuments,specifically
HowtheIntegrationServerpublishesdocumentstotheBroker.
HowtheIntegrationServerretrievesdocumentsfromtheBroker.
HowtheIntegrationServerpublishesandsubscribestodocumentslocally.
O v er v i e w o f t h e Pu b l i s h i n g P at h
WhentheIntegrationServerisconfiguredtoconnecttoaBroker,theIntegrationServercanpublishdocumentstotheBroker.TheBrokerthenroutesthedocumentstoallofthesubscribers.
ThefollowingsectionsdescribehowtheIntegrationServerinteractswiththeBrokerinthesepublishingscenarios:
PublishingadocumenttotheBroker.
PublishingadocumenttotheBrokerwhentheBrokerisnotavailable.
PublishingadocumenttotheBrokerandwaitingforareply(request/reply).
Note: Unlessotherwisenoted,thisguidedescribesthefunctionalityandinteractionofthwebMethodsIntegrationServerversion7.1andthewebMethodsBrokerversion7.1.
Note: IfaBrokerisnotconfiguredfortheIntegrationServer,allpublishesbecomelocalpublishes,anddeliveringdocumentstoaspecificrecipientisnotavailable.Formoreinformationaboutpublishingdocumentslocally,seeOverviewofLocalPublishingonpage 34.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
19/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
P u b l i s h i n g D o c u m e n t s t o t h e B r o k e r
WhentheIntegrationServersendsdocumentstoaconfiguredBroker,theIntegrationServereitherpublishesordeliversthedocument.
When
the
Integration
Server
publishes
adocument,
it
is
broadcast
to
all
subscribersTheBrokerroutesthedocumenttoallclientssubscribedtothatdocument.
WhentheIntegrationServerdeliversadocument,thedeliveryrequestidentifiesthedocumentrecipient.TheBrokerplacesthedocumentinthequeueforthespecifiedclientonly.
ThefollowingdiagramillustrateshowtheIntegrationServerpublishesordeliversdocumentstotheBrokerwhentheBrokerisconnected.
Publishing to the Broker
Step Description
1 ApublishingserviceontheIntegrationServersendsadocumenttothedispatcher(oranadapternotificationpublishesadocumentwhenaneventoccursontheresourcetheadaptermonitors).
BeforetheIntegrationServersendsthedocumenttothedispatcher,itvalidatesthedocumentagainstitspublishabledocumenttype.Ifthedocumentisnotvalid,theservicereturnsanexceptionspecifyingthevalidationerror.
2 Thedispatcherobtainsaconnectionfromtheconnectionpool.Theconnection
poolisareservedsetofconnectionsthattheIntegrationServerusestopublishdocumentstotheBroker.TopublishadocumenttotheBroker,theIntegrationServerusesaconnectionforthedefaultclient.
33 ThedispatchersendsthedocumenttotheBroker.
webMethods Integration Server webMethods Broker
3
4
2
Client QueueX
DispatcherPublishingService
ConnectionPool
Client QueueY
Memory
GuaranteedStorage
1
5
67 7
8/3/2019 Publish-Subscribe Developer's Guide 7.1
20/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
YoucanconfigurepublishabledocumenttypesandIntegrationServersothatIntegrationServerdoesnotvalidatedocumentswhentheyarepublished.Formoreinformationaboutvalidatingpublishabledocumenttypes,seeSpecifyingValidatioforaPublishableDocumentTypeonpage 69.
IfatransienterroroccurswhiletheIntegrationServerpublishesadocument,theauditsubsystemlogsthedocumentandassignsitastatusofFAILED.Atransienterroisanerrorthatarisesfromaconditionthatmightberesolvedquickly,suchastheunavailabilityofaresourceduetonetworkissuesorfailuretoconnecttoadatabaseYoucanusewebMethodsMonitortofindandresubmitdocumentswithastatusofFAILED.
4 TheBrokerexaminesthestoragetypeforthedocumenttodeterminehowtostorethedocument.
If
the
document
is
volatile,
the
Broker
stores
the
document
in
memory.
Ifthedocumentisguaranteed,theBrokerstoresthedocumentinmemoryandondisk.
5 TheBrokerroutesthedocumenttosubscribersbydoingoneofthefollowing:
Ifthedocumentwaspublished(broadcast),theBrokeridentifiessubscribersandplacesacopyofthedocumentintheclientqueueforeachsubscriber.
Ifthedocumentwasdelivered,theBrokerplacesthedocumentinthequeuefortheclientspecifiedinthedeliveryrequest.
Iftherearenosubscribersforthedocument,theBrokerreturnsan
acknowledgementtothepublisherandthendiscardsthedocument.If,however,adeadlettersubscriptionexistsforthedocument,theBrokerdepositsthedocumentinthequeuecontainingthedeadlettersubscriptionFormoreinformationaboutcreatingdeadlettersubscriptions,seewebMethodsBrokerClientJavaAPIReferenceGuide.
AdocumentremainsinthequeueontheBrokeruntilitispickedupbythesubscribingclient.Ifthetimetoliveforthedocumentelapses,theBrokerdiscardsthedocument.Formoreinformationaboutsettingtimetoliveforapublishabledocumenttype,seeSettingtheTimetoLiveforaPublishableDocumentTypeonpage 68.
6 Ifthedocumentisguaranteed,theBrokerreturnsanacknowledgementtothe
dispatchertoindicatesuccessfulreceiptandstorageofthedocument.Thedispatcherreturnstheconnectiontotheconnectionpool.
7 TheIntegrationServerreturnscontroltothepublishingservice,whichexecutesthenextstep.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
21/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Pub l i s h ing Docu men ts When the B rok e r Is No t Avai l ab le
TheIntegrationServerconstantlymonitorsitsconnectiontotheBrokerandwillalterthpublishingpathifitdeterminesthattheconfiguredBrokerisnotavailable.IftheBrokernotconnected,theIntegrationServerroutesguaranteeddocumentstoanoutbound
documentstore.ThedocumentsremainintheoutbounddocumentstoreuntiltheconnectiontotheBrokerisreestablished.
ThefollowingdiagramillustrateshowtheIntegrationServerpublishesdocumentswhetheBrokerisdisconnected.
Publishing when the Broker is not available
Step Description
1 ApublishingserviceontheIntegrationServersendsadocumenttothedispatcher(oranadapternotificationpublishesadocumentwhenaneventoccursontheresourcetheadaptermonitors).
BeforetheIntegrationServersendsthedocumenttothedispatcher,itvalidatesthedocumentagainstitspublishabledocumenttype.Ifthedocumentisnotvalid,theservicereturnsanexceptionspecifyingthevalidationerror.
2 ThedispatcherdetectsthattheBrokerisnotavailableanddoesoneofthefollowingdependingonthestoragetypeofthedocument:
Ifthedocumentisguaranteed,thedispatcherroutesthedocumenttothe
outbound
document
store
on
disk.
Ifthedocumentisvolatile,thedispatcherdiscardsthedocumentandthepublishingservicethrowsanexception.
TheIntegrationServerexecutesthenextstepinthepublishingservice.
webMethods Integration Server webMethods Broker
4
2
DispatcherPublishingService
ConnectionPool Memory
GuaranteedStorage
1
5
6
7
OutboundDocument
Store
3 Client QueueX
Client QueueY
8/3/2019 Publish-Subscribe Developer's Guide 7.1
22/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
33 WhentheIntegrationServerreestablishesaconnectiontotheBroker,theIntegrationServerobtainsasingleconnectionfromtheconnectionpool
4 The
Integration
Server
automatically
sends
the
documents
from
the
outbounddocumentstoretotheBroker.Toemptytheoutbounddocumentstoremorerapidly,theIntegrationServersendsthedocumentsinbatchesinsteadofoneatatime.
Note: TheIntegrationServerusesasingleconnectiontoemptytheoutbounddocumentstoretopreservepublicationorder.
5 TheBrokerexaminesthestoragetypeforthedocument,determinesthatitisguaranteedandstoresthedocumentinmemoryandondisk.
6 TheBrokerroutesthedocumenttosubscribersbydoingoneofthefollowing:
Ifthedocumentwaspublished(broadcast),theBrokeridentifiessubscribersandplacesacopyofthedocumentintheclientqueueforeachsubscriber.
Ifthedocumentwasdelivered,theBrokerplacesthedocumentinthequeuefortheclientspecifiedinthedeliveryrequest.
Iftherearenosubscribersforthedocument,theBrokerreturnsanacknowledgementtothepublisherandthendiscardsthedocument.If,however,adeadlettersubscriptionexistsforthedocument,theBrokerdepositsthedocumentinthequeuecontainingthedeadlettersubscriptionFormoreinformationaboutcreatingdeadlettersubscriptions,see
webMethods
Broker
Client
Java
API
Reference
Guide.AdocumentremainsinthequeueontheBrokeruntilthesubscribingclientpicksitup.Ifthetimetoliveforthedocumentelapses,theBrokerdiscardsthedocument.Formoreinformationaboutsettingtimetoliveforapublishabledocumenttype,seeSettingtheTimetoLiveforaPublishableDocumentTypeonpage 68.
7 TheBrokerreturnsanacknowledgementtotheIntegrationServertoindicatesuccessfulreceiptandstorageoftheguaranteeddocument.TheIntegrationServerremovesthedocumentfromtheoutbounddocumentstore.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
23/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
IfyoudonotwantpublisheddocumentsplacedintheoutbounddocumentstorewhentheBrokerisunavailable,youcanconfigureIntegrationServertothrowaServiceExceptioninstead.Thevalueofthewatt.server.publish.useCSQparamete
determineswhether
Integration
Server
places
documents
in
the
outbound
documenstoreorthrowsaServiceException.
AftertheconnectiontotheBrokerisreestablished,theIntegrationServersendsallnewlypublisheddocuments(guaranteedandvolatile)totheoutbounddocumentstoreuntiltheoutboundstorehasbeenemptied.ThisallowstheIntegrationServertmaintainpublicationorder.AftertheIntegrationServeremptiestheoutbounddocumentstore,theIntegrationServerresumespublishingdocumentsdirectlytothBroker.
IfIntegrationServermakes4attemptstotransmitadocumentfromtheoutbounddocumentstoretotheBrokerandallattemptsfail,theauditsubsystemlogsthedocumentandassignsitastatusofSTATUS_TOO_MANY_TRIES.
IfatransienterroroccurswhiletheIntegrationServerpublishesadocument,theauditsubsystemlogsthedocumentandassignsitastatusofFAILED.
YoucanconfigurepublishabledocumenttypesandIntegrationServersothatIntegrationServerdoesnotvalidatedocumentswhentheyarepublished.Formoreinformationaboutvalidatingpublishabledocumenttypes,seeSpecifyingValidatioforaPublishableDocumentTypeonpage 69.
Pub l i s h ing Docu men ts and Wa i t i ng f o r a Rep l y
Inapublishandwaitscenario,aservicepublishesadocument(arequest)andthenwaiforareplydocument.Thisissometimescalledtherequest/replymodel.Arequest/replycanbesynchronousorasynchronous.
Inasynchronousrequest/reply,thepublishingflowservicestopsexecutingwhileitwaitsforaresponse.Whentheservicereceivesareplydocumentfromthespecifiedclient,theserviceresumesexecution
Inanasynchronousrequest/reply,thepublishingflowservicecontinuesexecutingaftepublishingtherequestdocument.Thatis,thepublishingservicedoesnotwaitforareplybeforeexecutingthenextstepintheflowservice.Thepublishingflowservicemustinvokeaseparateservicetoretrievethereplydocument.
Tip! YoucanusewebMethodsMonitortofindandresubmitdocumentswithastatusofSTATUS_TOO_MANY_TRIESorFAILED.FormoreinformationaboutusingwebMethodsMonitor,seethewebMethodsMonitordocumentation.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
24/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
ThefollowingdiagramillustrateshowtheIntegrationServerandBrokerhandleasynchronousrequest/reply.
Publishing a document to the Broker and waiting for a reply
Step Description
1 Apublishingservicesendsadocument(therequest)tothedispatcher.TheIntegrationServerpopulatesthetagfieldinthedocumentenvelopewitha
uniqueidentifierthatwillbeusedtomatchupthereplydocumentwiththisrequest.
Thepublishingserviceentersintoawaitingstate.Theservicewillnotresumeexecutionuntilitreceivesareplyfromasubscriberorthewaittimeelapses.TheIntegrationServerbeginstrackingthewaittimeassoonasitpublishesthedocument.
BeforetheIntegrationServersendsthedocumenttothedispatcher,itvalidatesthedocumentagainstitspublishabledocumenttype.Ifthedocumentisnotvalid,theservicereturnsanexceptionspecifyingthevalidationerror.Theserviceunblocks,butwithanexception.
webMethods Integration Server webMethods Broker
2
DispatcherPublishingService
ConnectionPool Memory
GuaranteedStorage
1
4
5
7
3
PendingReplies
11 10
6
PublishingServers
Request/ReplyClient Queue
89
Client QueueX
Client QueueY
8/3/2019 Publish-Subscribe Developer's Guide 7.1
25/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
2 Thedispatcherobtainsaconnectionfromtheconnectionpool.TheconnectionpoolisareservedsetofconnectionsthattheIntegrationServerusestopublishdocumentstotheBroker.TopublisharequestdocumenttotheBroker,the
IntegrationServerusesaconnectionfortherequest/replyclient.
Note: IftheBrokerisnotavailable,thedispatcherroutesthedocumenttotheoutbounddocumentstore.Formoreinformation,seePublishingDocumentsWhentheBrokerIsNotAvailableonpage 21.
33 ThedispatchersendsthedocumenttotheBroker.
4 TheBrokerexaminesthestoragetypeforthedocumenttodeterminehowtostorethedocument.
Ifthedocumentisvolatile,theBrokerstoresthedocumentinmemory.
Ifthedocumentisguaranteed,theBrokerstoresthedocumentinmemoryandondisk.
5 TheBrokerroutesthedocumenttosubscribersbydoingoneofthefollowing:
Ifthedocumentwaspublished(broadcast),theBrokeridentifiessubscribersandplacesacopyofthedocumentintheclientqueueforeachsubscriber.
Ifthedocumentwasdelivered,theBrokerplacesthedocumentinthequeuefortheclientspecifiedinthedeliveryrequest.
Iftherearenosubscribersforthedocument,theBrokerreturnsanacknowledgementtothepublisherandthendiscardsthedocument.If,however,adeadlettersubscriptionexistsforthedocument,theBrokerdepositsthedocumentinthequeuecontainingthedeadlettersubscriptionFormoreinformationaboutcreatingdeadlettersubscriptions,seewebMethodsBrokerClientJavaAPIReferenceGuide.
AdocumentremainsinthequeueontheBrokeruntilitispickedupbythesubscribingclient.Ifthetimetoliveforthedocumentelapses,theBrokerdiscardsthedocument.Formoreinformationaboutsettingtimetoliveforapublishabledocumenttype,seeSettingtheTimetoLiveforaPublishableDocumentTypeonpage 68.
6Ifthedocumentisguaranteed,theBrokerreturnsanacknowledgementtothedispatchertoindicatesuccessfulreceiptandstorageofthedocument.Thedispatcherreturnstheconnectiontotheconnectionpool.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
26/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
Iftherequestingservicespecifiedapublishabledocumenttypeforthereplydocument,thereplydocumentmustconformtothespecifiedtype.Otherwise,thereplydocumentcanbeaninstanceofanypublishabledocumenttype.
Asinglerequestmightreceivemanyreplies.TheIntegrationServerthatinitiatedthrequestusesonlythefirstreplydocumentitretrievesfromtheBroker.TheIntegrationServerdiscardsallotherreplies.Firstisarbitrarilydefined.ThereisnoguaranteeprovidedfortheorderinwhichtheBrokerprocessesincomingreplies.
Allreplydocumentsaretreatedasvolatiledocuments.Volatiledocumentsarestoreinmemoryandwillbelostifresourceonwhichthereplydocumentislocatedshutsdownorifaconnectionislostwhilethereplydocumentisintransit.
Ifthewaittimeelapsesbeforetheservicereceivesareply,theIntegrationServerendtherequest,andtheservicereturnsanulldocumentthatindicatestherequesttimedout.TheIntegrationServerthenexecutesthenextstepintheflowservice.Ifareply
documentarrives
after
the
flow
service
resumes
execution,
the
Integration
Server
rejectsthedocumentandcreatesajournallogmessagestatingthatthedocumentwarejectedbecausethereisnothreadwaitingforthedocument.
YoucanconfigurepublishabledocumenttypesandIntegrationServersothatIntegrationServerdoesnotvalidatedocumentswhentheyarepublished.Formore
7 Subscribersretrieveandprocessthedocument.
Asubscriberusesthepub.publish:replyservicetocomposeandpublishareply
document.This
service
automatically
populates
the
tag
field
of
the
reply
documentenvelopewiththesamevalueusedinthetagfieldoftherequestdocumentenvelope.
Thepub.publish:replyservicealsoautomaticallyspecifiestherequestingclientastherecipientofthereplydocument
8 OneormoresubscriberssendreplydocumentstotheBroker.TheBrokerstoresthereplydocumentsinmemory.
TheBrokerplacesthereplydocumentsintherequest/replyclientqueuefortheIntegrationServerthatinitiatedtherequest.
9 TheIntegrationServerthatinitiatedtherequestobtainsarequest/replyclient
fromthe
connection
pool
and
retrieves
the
reply
documents
from
the
Broker.
10 TheIntegrationServerusesthetagvalueofthereplydocumenttomatchupthereplywiththeoriginalrequest.
11 TheIntegrationServerplacesthereplydocumentinthepipelineofthewaitingservice.Thewaitingserviceresumesexecution.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
27/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
informationaboutvalidatingpublishabledocumenttypes,seeSpecifyingValidatioforaPublishableDocumentTypeonpage 69.
O v er v i e w o f t h e Su b s c r i b e Pa t h
WhenIntegrationServerisconnectedtoaBroker,thepathadocumentfollowsonthesubscribersideincludesretrievingthedocumentfromtheBroker,storingthedocumentonIntegrationServer,andprocessingthedocument.Thesubscriptionpathforadocumentdependsonwhetherthedocumentwaspublishedtoallsubscribers(broadcasordeliveredtoIntegrationServerdirectly.
ThefollowingsectionsdescribehowIntegrationServerinteractswiththeBrokertoretrievepublishedanddelivereddocuments.
The Subsc r i be Pa th f o r Pub l i s hed Documen ts
Whenadocumentispublishedorbroadcast,theBrokerplacesacopyofthedocumentitheclientqueueforeachsubscribingtrigger.Eachsubscribingtriggerwillretrieveandprocessthedocument.
Thefollowingdiagramillustratesthepathofadocumenttoasubscriber(trigger)ontheIntegrationServer.
Note: ForinformationaboutthesubscribepathfordocumentsthatmatchajoinconditionseeSubscribePathforDocumentsthatSatisfyaJoinConditiononpage 173.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
28/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Subscribe path for published documents
Step Description
1 ThedispatcherontheIntegrationServerusesaserverthreadtorequestdocumentsfromatriggersclientqueueontheBroker.
Note: EachtriggerontheIntegrationServerhasacorrespondingclientqueueontheBroker.
2 Thethreadretrievesabatchofdocumentsforthetrigger.
33 Thedispatcherplacesthedocumentsinthetriggersqueueinthetriggerdocumentstore.Thetriggerdocumentstoreissavedinmemory.The
dispatcherthenreleasestheserverthreadusedtoretrievethedocuments.
Dispatcher
TriggerServiceX1
5
6
4
1
3
webMethods Integration ServerwebMethods Broker
Memory
GuaranteedStorage
2
Trigger QueueX
Trigger QueueY
Trigger Document Store
TriggerServiceX2
TriggerServiceY1
TriggerServiceY2
Client Queue
X
Client QueueY
8/3/2019 Publish-Subscribe Developer's Guide 7.1
29/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
4 Thedispatcherobtainsathreadfromtheserverthreadpool,pullsadocumentfromthetriggerqueue,andevaluatesthedocumentagainsttheconditionsinthetrigger.
Note: Ifexactlyonceprocessingisconfiguredforthetrigger,theIntegrationServerfirstdetermineswhetherthedocumentisaduplicateofonethathasalreadybeenprocessedbythetrigger.TheIntegrationServercontinuesprocessingthedocumentonlyifthedocumentisnew.
5 Ifthedocumentmatchesatriggercondition,thedispatcherexecutesthetriggerserviceassociatedwiththatcondition.
Ifthedocumentdoesnotmatchatriggercondition,theIntegrationServerdiscardsthedocument,returnsanacknowledgementtotheBroker,andreturnstheserverthreadtotheserverthreadpool.TheIntegrationServeralso
generatesajournallogmessagestatingthatthedocumentdidnotmatchacondition.
6 Afterthetriggerserviceexecutestocompletion(successorerror),oneofthefollowingoccurs:
Ifthetriggerserviceexecutedsuccessfully,theIntegrationServerreturnsanacknowledgementtotheBroker(ifthisisaguaranteeddocument).TheIntegrationServerthenremovesthecopyofthedocumentfromthetriggerqueueandreturnstheserverthreadtothethreadpool.
Ifaserviceexceptionoccurs,thetriggerserviceendsinerrorandtheIntegrationServerrejectsthedocument.Ifthedocumentisguaranteed,the
IntegrationServerreturnsanacknowledgementtotheBroker.TheIntegrationServerremovesthecopyofthedocumentfromthetriggerqueue,returnstheserverthreadtothethreadpool,andsendsanerrordocumenttoindicatethatanerrorhasoccurred.
Ifatransienterroroccursduringtriggerserviceexecutionandtheservicecatchestheerror,wrapsitandrethrowsitasanISRuntimeException,thentheIntegrationServerwaitsforthelengthoftheretryintervalandreexecutestheserviceusingtheoriginaldocumentasinput.IftheIntegrationServerreachesthemaximumnumberofretriesandthetriggerservicestillfailsbecauseofatransienterror,theIntegrationServertreatsthelastfailureasaserviceerror.Formoreinformationaboutretryinga
triggerservice,
see
Configuring
Transient
Error
Handling
on
page 140.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
30/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
Afterreceivinganacknowledgement,theBrokerremovesitscopyofthedocumentfromguaranteedstorage.TheIntegrationServerreturnsanacknowledgementforguaranteeddocumentsonly.
IftheIntegrationServershutsdownorreconnectstotheBrokerbeforeacknowledgingaguaranteeddocument,theIntegrationServerrecoversthedocumentfromtheBrokerwhentheserverrestartsortheconnectionisreestablished.(Thatis,thedocumentsareredelivered.)Formoreinformationaboutguaranteeddocuments,seeSelectingaDocumentStorageTypeonpage 66.
Ifatriggerservicegeneratesauditdataonerrorandincludesacopyoftheinputpipelineintheauditlog,youcanusewebMethodsMonitortoreinvokethetriggerserviceatalatertime.Formoreinformationaboutconfiguringservicestogenerateauditdata,seethewebMethodsDeveloperUsersGuide.
Itispossiblethatadocumentcouldsatisfymorethanoneconditioninatrigger.
However,the
Integration
Server
executes
only
the
service
associated
with
the
first
satisfiedcondition.
TheprocessingmodeforatriggerdetermineswhethertheIntegrationServerprocessesdocumentsinatriggerqueueseriallyorconcurrently.InserialprocessingtheIntegrationServerprocessesthedocumentsoneatatimeintheorderinwhichthdocumentswereplacedinthetriggerqueue.Inconcurrentprocessing,theIntegratioServerprocessesasmanydocumentsasitcanatonetime,butnotnecessarilyinthesameorderinwhichthedocumentswereplacedinthequeue.Formoreinformationaboutdocumentprocessing,seeSelectingMessagingProcessingonpage 133.
Ifatransienterroroccursduringdocumentretrievalorstorage,theauditsubsystemlogsthedocumentandassignsitastatusofFAILED.Atransienterrorisanerrortha
arisesfromaconditionthatmightberesolvedlater,suchastheunavailabilityofaresourceduetonetworkissuesorfailuretoconnecttoadatabase.YoucanusewebMethodsMonitortofindandresubmitdocumentswithaFAILEDstatus.FormoreinformationaboutusingwebMethodsMonitor,seethewebMethodsMonitordocumentation.
YoucanconfigureatriggertosuspendandretryatalatertimeifretryfailureoccurRetryfailureoccurswhenIntegrationServermakesthemaximumnumberofretryattemptsandthetriggerservicestillfailsbecauseofanISRuntimeException.Formorinformationabouthandlingretryfailure,seeHandlingRetryFailureonpage 141
The Subsc r i be Pa th f o r De l i ve red Documen tsApublishingservicecandeliveradocumentbyspecifyingthedestinationofthedocument.Thatis,thepublishingservicespecifiestheBrokerclientthatistoreceivethedocument.WhentheBrokerreceivesadelivereddocument,itplacesacopyofthedocumentinthequeueforthespecifiedclientonly.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
31/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Typically,documentsaredeliveredtothedefaultclient.ThedefaultclientistheBrokerclientcreatedfortheIntegrationServerwhentheIntegrationServerfirstconfiguresitsconnectiontotheBroker.
Thefollowingdiagramillustratesthesubscriptionpathforadocumentdeliveredtothedefaultclient.
Subscribe path for documents delivered to the default client
Note: Ifapublishingservicespecifiesanindividualtriggerasthedestinationofthedocument(thepublishingservicespecifiesatriggerclientIDasthedestinationID),thesubscribepaththedocumentfollowsisthesameasthepathfollowedbyapublisheddocument.
Dispatcher
TriggerService
X1
5
66
1
Client QueueDefault Client
4
webMethods Integration ServerwebMethods Broker
Memory
GuaranteedStorage
2
Trigger QueueX
Trigger QueueY
Trigger Document Store
TriggerService
X2
TriggerService
Y1
TriggerService
Y2
Default Document Store
3
7 7
88
8/3/2019 Publish-Subscribe Developer's Guide 7.1
32/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Step Description
1 ThedispatcherontheIntegrationServerrequestsdocumentsfromthedefaultclientsqueueontheBroker.
Note: ThedefaultclientistheBrokerclientcreatedfortheIntegrationServer.TheBrokerplacesdocumentsinthedefaultclientsBrokerqueueonlyifthepublisherdeliveredthedocumenttotheIntegrationServersclientID.
2 Thethreadretrievesdocumentsdeliveredtothedefaultclientinbatches.
ThenumberofdocumentsthethreadretrievesatonetimeisdeterminedbythecapacityandrefilllevelofthedefaultdocumentstoreandthenumberofdocumentsavailableforthedefaultclientontheBroker.Formoreinformationaboutconfiguringthedefaultdocumentstore,seethewebMethodsIntegrationServerAdministratorsGuide.
33 Thedispatcherplacesacopyofthedocumentsinmemoryinthedefaultdocumentstore.
4 Thedispatcheridentifiessubscriberstothedocumentandroutesacopyofthedocumenttoeachsubscriberstriggerqueue.
Inthecaseofdelivereddocuments,theIntegrationServersavesthedocumentstoatriggerqueue.Thetriggerqueueislocatedwithinatriggerdocumentstorethatissavedondisk.
5 TheIntegrationServerremovesthecopyofthedocumentfromthedefaultdocumentstoreand,ifthedocumentisguaranteed,returnsanacknowledgementtotheBroker.TheBrokerremovesthedocumentfromthe
default
clients
queue.
6 Thedispatcherobtainsathreadfromtheserverthreadpool,pullsthedocumentfromthetriggerqueue,andevaluatesthedocumentagainsttheconditionsinthetrigger.
Note: Ifexactlyonceprocessingisconfiguredforthetrigger,theIntegrationServerfirstdetermineswhetherthedocumentisaduplicateofonealreadyprocessedbythetrigger.TheIntegrationServercontinuesprocessingthedocumentonlyifthedocumentisnew.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
33/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
TheIntegrationServersavesdelivereddocumentsinatriggerdocumentstorelocateondisk.TheIntegrationServersavespublisheddocumentsinatriggerdocumentstorelocatedinmemory.
IftheIntegrationServershutsdownbeforeprocessingaguaranteeddocumentsave
inatrigger
document
store
on
disk,
the
Integration
Server
recovers
the
document
fromthetriggerdocumentstorewhenitrestarts.Volatiledocumentsaresavedinmemoryandarenotrecovereduprestart.
Ifaservicegeneratesauditdataonerrorandincludesacopyoftheinputpipelineintheauditlog,youcanusewebMethodsMonitortoreinvokethetriggerserviceata
7 Ifthedocumentmatchesatriggercondition,theIntegrationServerexecutesthetriggerserviceassociatedwiththatcondition.
Ifthe
document
does
not
match
atrigger
condition,
the
Integration
Server,
sendsanacknowledgementtothetriggerqueue,discardsthedocument(removesitfromthetriggerqueue),andreturnstheserverthreadtotheserverthreadpool.TheIntegrationServeralsogeneratesajournallogmessagestatingthatthedocumentdidnotmatchacondition.
8 Afterthetriggerserviceexecutestocompletion(successorerror),oneofthefollowingoccurs:
Ifthetriggerserviceexecutedsuccessfully,theIntegrationServerreturnsanacknowledgementtothetriggerqueue(ifthisisaguaranteeddocument),removesthedocumentfromthetriggerqueue,andreturnstheserverthreadtothethreadpool.
Ifaserviceexceptionoccurs,thetriggerserviceendsinerrorandtheIntegrationServerrejectsthedocument,removesthedocumentfromthetriggerqueue,returnstheserverthreadtothethreadpool,andsendsanerrordocumenttoindicatethatanerrorhasoccurred.Ifthedocumentisguaranteed,theIntegrationServerreturnsanacknowledgementtothetriggerqueue.Thetriggerqueueremovesitscopyoftheguaranteeddocumentfromstorage.
Ifatransienterroroccursduringtriggerserviceexecutionandtheservicecatchestheerror,wrapsitandrethrowsitasanISRuntimeException,thentheIntegrationServerwaitsforthelengthoftheretryintervalandreexecutestheserviceusingtheoriginaldocumentasinput.IftheIntegration
Serverreachesthemaximumnumberofretriesandthetriggerservicestillfailsbecauseofatransienterror,theIntegrationServertreatsthelastfailureasaserviceerror.Formoreinformationaboutretryingatriggerservice,seeConfiguringTransientErrorHandlingonpage 140.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
34/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
latertime.Formoreinformationaboutconfiguringservicestogenerateauditdata,sethewebMethodsDeveloperUsersGuide.
Itispossiblethatadocumentcouldmatchmorethanoneconditioninatrigger.However,theIntegrationServerexecutesonlytheserviceassociatedwiththefirst
matchedcondition.
TheprocessingmodeforatriggerdetermineswhethertheIntegrationServerprocessesdocumentsinatriggerqueueseriallyorconcurrently.InserialprocessingtheIntegrationServerprocessesthedocumentsoneatatimeintheorderinwhichthdocumentswereplacedinthetriggerqueue.Inconcurrentprocessing,theIntegratioServerprocessesasmanydocumentsasitcanatonetime,butnotnecessarilyinthesameorderinwhichthedocumentswereplacedinthequeue.Formoreinformationaboutdocumentprocessing,seeSelectingMessagingProcessingonpage 133.
Ifatransienterroroccursduringdocumentretrievalorstorage,theauditsubsystemlogsthedocumentandassignsitastatusofFAILED.YoucanusewebMethodsMonitortofindandresubmitdocumentswithaFAILEDstatus.Formoreinformatio
aboutusingwebMethodsMonitor,seethewebMethodsMonitordocumentation.
YoucanconfigureatriggertosuspendandretryatalatertimeifretryfailureoccurRetryfailureoccurswhenIntegrationServermakesthemaximumnumberofretryattemptsandthetriggerservicestillfailsbecauseofanISRuntimeException.Formorinformationabouthandlingretryfailure,seeHandlingRetryFailureonpage 141
O v er v i e w o f L o c a l P u b l i s h i n g
LocalpublishingreferstotheprocessofpublishingadocumentwithintheIntegrationServer.OnlysubscriberslocatedonthesameIntegrationServercanreceiveandprocess
thedocument.
In
local
publishing,
the
document
remains
within
the
Integration
Server.
ThereisnoBrokerinvolvement.
LocalpublishingoccurswhentheservicethatpublishesthedocumentspecifiesthatthedocumentshouldbepublishedlocallyorwhentheIntegrationServerisnotconfiguredtconnecttoaBroker.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
35/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Thefollowingdiagramillustrateshowthepublishandsubscribepathsforalocallypublisheddocument.
Publishing a document locally
Step Description
1 ApublishingserviceontheIntegrationServersendsadocumenttothedispatcher.
BeforetheIntegrationServersendsthedocumenttothedispatcher,itvalidatesthedocumentagainstitspublishabledocumenttype.Ifthedocumentisnotvalid,theservicereturnsanexceptionspecifyingthevalidationerror.
2 Thedispatcherdoesoneofthefollowing:
Thedispatcherdetermineswhichtriggerssubscribetothedocumentand
placesacopyofthedocumentineachsubscriberstriggerqueue.Thedispatchersaveslocallypublisheddocumentsinatriggerdocumentstorelocatedondisk.
Iftherearenosubscribersforthedocument,thedispatcherdiscardsthedocument.
TriggerServiceX1
33
1
2
webMethods Integration Server
Trigger Queue
X
Trigger Queue
Z
Trigger Document Store
TriggerServiceX2
TriggerServiceZ1
TriggerServiceZ2
Dispatcher
4 4
55
PublishingService
Trigger Queue
Y
TriggerServiceY1
TriggerServiceY2
8/3/2019 Publish-Subscribe Developer's Guide 7.1
36/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
33 Thedispatcherobtainsathreadfromtheserverthreadpool,pullsthedocumentfromthetriggerqueue,andevaluatesthedocumentagainsttheconditionsinthetrigger.
Note: Ifexactlyonceprocessingisconfiguredforthetrigger,theIntegrationServerfirstdetermineswhetherthedocumentisaduplicateofonealreadyprocessedbythetrigger.TheIntegrationServercontinuesprocessingthedocumentonlyifthedocumentisnew.
4 Ifthedocumentmatchesatriggercondition,thedispatcherexecutesthetriggerserviceassociatedwiththatcondition.
Ifthedocumentdoesnotmatchatriggercondition,theIntegrationServersendsanacknowledgementtothetriggerqueue,discardsthedocument(removesitfromthetriggerqueue),andreturnstheserverthreadtotheserver
threadpool.
5 Afterthetriggerserviceexecutestocompletion(successorerror),oneofthefollowingoccurs:
Ifthetriggerserviceexecutedsuccessfully,theIntegrationServersendsanacknowledgementtothetriggerqueue(ifthisisaguaranteeddocument),removesthedocumentfromthetriggerqueue,andreturnstheserverthreadtothethreadpool.
Ifaserviceexceptionoccurs,thetriggerserviceendsinerrorandtheIntegrationServerrejectsthedocument,removesthedocumentfromthetriggerqueue,andreturnstheserverthreadtothethreadpool.Ifthe
documentisguaranteed,theIntegrationServersendsanacknowledgementtothetriggerqueue.
Ifatransienterroroccursduringtriggerserviceexecutionandtheservicecatchestheerror,wrapsitandrethrowsitasanISRuntimeException,thentheIntegrationServerwaitsforthelengthoftheretryintervalandreexecutestheserviceusingtheoriginaldocumentasinput.IfIntegrationServerreachesthemaximumnumberofretriesandthetriggerservicestillfailsbecauseofatransienterror,theIntegrationServertreatsthelastfailureasaserviceerror.Formoreinformationaboutretryingatriggerservice,seeConfiguringTransientErrorHandlingonpage 140.
Step Description
8/3/2019 Publish-Subscribe Developer's Guide 7.1
37/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
Notes:
YoucanconfigurepublishabledocumenttypesandIntegrationServersothatIntegrationServerdoesnotvalidatedocumentswhentheyarepublished.Formoreinformationaboutvalidatingpublishabledocumenttypes,seeSpecifyingValidatio
foraPublishable
Document
Type
on
page 69.
IntegrationServersaveslocallypublisheddocumentsinatriggerdocumentstorelocatedondisk.IfIntegrationServershutsdownbeforeprocessingalocallypublishedguaranteeddocument,IntegrationServerrecoversthedocumentfromthtriggerdocumentstorewhenitrestarts.IntegrationServerdoesnotrecovervolatiledocumentswhenitrestarts.
Ifasubscribingtriggerqueuereachesitsmaximumcapacity,youcanconfigureIntegrationServertorejectlocallypublisheddocumentsforthattriggerqueue.Formoreinformationaboutthisfeature,seethedescriptionofthewatt.server.publish.local.rejectOOSparameterinthewebMethodsIntegrationServerAdministratorsGuide.
Ifaservicegeneratesauditdataonerrorandincludesacopyoftheinputpipelineintheauditlog,youcanusewebMethodsMonitortoreinvokethetriggerserviceatalatertime.Formoreinformationaboutconfiguringservicestogenerateauditdata,sethewebMethodsDeveloperUsersGuide.
Itispossiblethatadocumentcouldmatchmorethanoneconditioninatrigger.However,IntegrationServerexecutesonlytheserviceassociatedwiththefirstmatchedcondition.
TheprocessingmodeforatriggerdetermineswhethertheIntegrationServerprocessesdocumentsinatriggerqueueseriallyorconcurrently.InserialprocessingIntegrationServerprocessesthedocumentsoneatatimeintheorderinwhichthe
documentswereplacedinthetriggerqueue.Inconcurrentprocessing,theIntegratioServerprocessesasmanydocumentsasitcanatonetime,butnotnecessarilyinthesameorderinwhichthedocumentswereplacedinthequeue.Formoreinformationaboutdocumentprocessing,seeSelectingMessagingProcessingonpage 133.
YoucanconfigureatriggertosuspendandretryatalatertimeifretryfailureoccurRetryfailureoccurswhenIntegrationServermakesthemaximumnumberofretryattemptsandthetriggerservicestillfailsbecauseofanISRuntimeException.Formorinformationabouthandlingretryfailure,seeHandlingRetryFailureonpage 141
YoucanconfigureIntegrationServertostrictlyenforcealocallypublisheddocumentstimetoliveanddiscardthedocumentbeforeprocessingitifthedocumenthasexpired.Formoreinformationaboutthisfeature,seethedescriptionothewatt.server.trigger.local.checkTTL parameterinthewebMethodsIntegrationServeAdministratorsGuide.
8/3/2019 Publish-Subscribe Developer's Guide 7.1
38/236
2. An Overview of the Publish and Subscri be Path
Publish-Subscribe Developers Guide Version 7.1
8/3/2019 Publish-Subscribe Developer's Guide 7.1
39/236
Publish-Subscribe Developers Guide Version 7.1
Ch ap t er 3. St ep s f o r B u i l d i n g a Pu b l i sh -an d -Su b s cr i b eS o l u t i o n
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Step 1: Research the Integration Problem and Determine Solution . . . . . . . . . . . . . . . . . . . . . . 41
Step 2: Determine the Production Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Step 3: Create the Publishable Document Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Step 4: Make the Publishable Document Types Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Step 5: Create the Services that Publish the Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Step 6: Create the Services that Process the Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Step 7: Define the Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Step 8: Synchronize the Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
8/3/2019 Publish-Subscribe Developer's Guide 7.1
40/236
3. Steps for Building a Publish-and-Subscribe Solutio
Publish-Subscribe Developers Guide Version 7.1
I n t r o d u c t i o n
Therearetwosidesofapublishandsubscribemodelintegrationsolution.Onesideisthpublishingsideandtheotheristhesubscribingside.Thetablebelowlistswhatyoumu
create
for
each
side
of
the
integration
solution.
Thefollowingtableliststhetasksthatyouneedtoperformtobuildanintegration
solutionandwhetherthepublishingsideorthesubscribingsideisresponsibleforthetask.
On the publishing side, create: On the subscribing side, create:
Publishabledocumenttypesforthedocumentsthataretobepublished
Servicesthatpublishthedocuments
Servicestoprocesstheincomingdocumentsthatarepublishedbythepublishingside
Triggersthatassociatestheincomingdocumentswithservicesthatprocessesthedocuments
Step Task Publishing Subscribing
1 Researchtheintegrationproblemanddeterminehowyouwanttoresolveit.
2 Determinethedevelopmentenvironment.
3 Createthepublishabledocumenttypesforthedocumentstobepublished.
4 Makethepublishabledocumenttypesavailabletothesubscribingside.
5 Createtheservicesthatpublishthedocuments.
6 Createtheserv