Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN TIBCO Rendezvous Installation) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, Rendezvous and TIBCO Rendezvous are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright 19972008 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information
| iii
Contents
Chapter 2 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
tibrv_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 tibrv_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 tibrv_SetCodePages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 tibrv_Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 tibrvSecureDaemon_SetDaemonCert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 tibrvSecureDaemon_SetUserCertWithKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 tibrvSecureDaemon_SetUserCertWithKeyBin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 tibrvSecureDaemon_SetUserNameWithPassword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter 3 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Message Ownership and Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Validity of Data Extracted From Message Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scalar Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pointer Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting Snapshot References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiple Subscription Snapshots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 24 25 28 28
iv
| Contents
Field Names and Field Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Finding a Field Instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Strings and Character Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 tibrvLocalData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 tibrvMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 tibrvMsgDateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 tibrvMsgField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 tibrvMsg_GetCurrentTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 tibrvMsg_AddField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Nested Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Opaque Byte Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add XML Byte Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add DateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 45 47 49 50 51 52 54
tibrvMsg_ClearReferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 tibrvMsg_ConvertToString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 tibrvMsg_Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 tibrvMsg_CreateCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 tibrvMsg_CreateFromBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 tibrvMsg_Destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 tibrvMsg_Detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 tibrvMsg_Expand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 tibrvMsg_GetAsBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 tibrvMsg_GetAsBytesCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 tibrvMsg_GetByteSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 tibrvMsg_GetField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get Scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get Nested Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get String. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get Opaque Byte Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get XML Byte Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get DateTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 70 72 75 77 79 81 83
Contents v
tibrvMsg_GetSendSubject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 tibrvMsg_MarkReferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 tibrvMsg_RemoveField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 tibrvMsg_RemoveFieldInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 tibrvMsg_Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 tibrvMsg_SetReplySubject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 tibrvMsg_SetSendSubject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 tibrvMsg_UpdateField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Update Scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Update Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Update Nested Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Update String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Update Opaque Byte Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Update XML Byte Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Update DateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
vi
| Contents
Chapter 5 Event Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Operations by Functional Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Operations in Alphabetical Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 tibrvQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 tibrvQueueHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 tibrvQueueLimitPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 tibrvQueueOnComplete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 tibrvQueue_Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 tibrvQueue_Destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 tibrvQueue_Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 tibrvQueue_GetCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 tibrvQueue_GetHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 tibrvQueue_GetLimitPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 tibrvQueue_GetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 tibrvQueue_GetPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 tibrvQueue_Poll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 tibrvQueue_RemoveHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 tibrvQueue_SetHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 tibrvQueue_SetLimitPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 tibrvQueue_SetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 tibrvQueue_SetPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 tibrvQueue_TimedDispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 tibrvQueue_TimedDispatch_Cobol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Contents vii
tibrvDispatcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 tibrvDispatcher_Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 tibrvDispatcher_Destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 tibrvDispatcher_GetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 tibrvDispatcher_SetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
viii
| Contents
tibrvftMonitor_Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 tibrvftMonitor_Destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 tibrvftMonitor_GetGroupName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 tibrvftMonitor_GetQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 tibrvftMonitor_GetTransport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Contents ix
tibrvcmTransport_RemoveSendState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 tibrvcmTransport_ReviewLedger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 tibrvcmReviewCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 tibrvcmTransport_Send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 tibrvcmTransport_SendReply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 tibrvcmTransport_SendRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 tibrvcmTransport_SetDefaultCMTimeLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 tibrvcmTransport_SyncLedger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 tibrvMsg_GetCMSender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 tibrvMsg_GetCMSequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 tibrvMsg_GetCMTimeLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 tibrvMsg_SetCMTimeLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
| Contents
Adding Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 Extracting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 Custom Datatype Checklist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 Convenience Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 Get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 Add and Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 tibrvMsg_SetHandlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 tibrvMsgDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 tibrvMsgData_ByteSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 tibrvMsgData_Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 tibrvMsgData_CopyBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 tibrvMsgData_Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 tibrvMsgData_Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 tibrvMsgData_GetBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 tibrvMsgData_GetSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 tibrvMsgData_Malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 tibrvMsgData_SetSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
| xi
Figures
Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15
Extracting a Scalar Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Extracting a Pointer Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Updating a Pointer Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Updating a Submessage Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Mark and Clear References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Completion when Callback Functions are in Progress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Completion when Callback Functions are Not in Progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Listener Activation and Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Timer Activation and Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Writing Fields into a Messages Wire Buffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 tibrvMsgData_CopyBytes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 Advancing the Wire Buffer Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 tibrvMsgData_GetBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 tibrvMsgData_GetSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 tibrvMsgData_SetSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
xii
| Figures
| xiii
Tables
Table 1 Table 2
Date and Time Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Architecture of Message and Data Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
xiv
| Tables
| xv
Preface
This manual describes the TIBCO Rendezvous API for COBOL programmers.
Topics
Related Documentation, page xvi How to Contact TIBCO Customer Support, page xviii
xvi
| Related Documentation
Related Documentation
This section lists documentation resources you may find useful.
Preface xvii
TIBCO Rendezvous Administration Begins with a checklist of action items for system and network administrators. This book describes the mechanics of Rendezvous licensing, network details, plus a chapter for each component of the Rendezvous software suite. Readers should have TIBCO Rendezvous Concepts at hand for reference.
TIBCO Rendezvous Configuration Tools Detailed descriptions of each Java class and method in the Rendezvous configuration API, plus a command line tool that can generate and apply XML documents representing component configurations. Readers should already be familiar with the Java programming language, as well as the material in TIBCO Rendezvous Administration.
TIBCO Rendezvous Installation Includes step-by-step instructions for installing Rendezvous software on various operating system platforms.
TIBCO Rendezvous for z/OS Installation and Configuration Includes step-by-step instructions for installing Rendezvous software on z/OS platforms.
TIBCO Rendezvous for z/OS COBOL Reference Detailed descriptions of each datatype and function in the Rendezvous COBOL API. Readers should already be familiar with the COBOL programming language, z/OS, as well as the material in TIBCO Rendezvous Concepts.
TIBCO Rendezvous Release Notes Lists new features, changes in functionality, deprecated features, migration and compatibility information, closed issues and known issues.
|1
Chapter 1
Programmers Checklist
This chapter explains how to compile, link and run TIBCO Rendezvous and z/OS COBOL programs.
Topics
Programming Environment, page 2
| Chapter 1
Programmers Checklist
Programming Environment
When developing or deploying Rendezvous COBOL programs, remember these steps:
Code
Call names have changed in release 8.1. All calls now begin with the prefix tibrv instead of trvOS. Old call names are deprecated, and will become obsolete in release 9. New calls added in release 8 exist only with prefix tibrv.
Compile
Compile programs with the IBM z/OS COBOL compiler.
Link
Link with the appropriate API library.
Run
Be sure that the daemon can run on each application host computer. The users data set must contain a version appropriate for the application host. For more information, see TIBCO Rendezvous Administration. Be sure that the Rendezvous daemon process can access the Rendezvous license ticket file, TIBRVTKT. The users data set must contain this file. For more information, see TIBCO Rendezvous Administration.
|3
Chapter 2
Environment
This chapter describes the functions that open and close the internal machinery upon which Rendezvous software depends.
Topics
Function
tibrv_Close tibrv_Open tibrv_SetCodePages
Description Stop and Destroy Rendezvous internal machinery. Create and start Rendezvous internal machinery. Set code pages for automatic string conversion on EBCDIC platforms (namely, i5/OS and z/OS). Identify the Rendezvous API release number.
Page 4 5 6 8
tibrv_Version
Secure Daemon
tibrvSecureDaemon_ SetDaemonCert tibrvSecureDaemon_ SetUserCertWithKey tibrvSecureDaemon_ SetUserCertWithKey Bin tibrvSecureDaemon_ SetUserNameWithPas sword
Register trust in a secure daemon. Register a (PEM) certificate with private key for identification to secure daemons. Register a (PKCS #12) certificate with private key for identification to secure daemons. Register a (PEM) certificate with private key for identification to secure daemons.
9 11 12
14
| Chapter 2
Environment
tibrv_Close
Function Declaration
CALL tibrv_Close RETURNING TIBRV-STATUS END-CALL RVBCLOSE
Stop and destroy Rendezvous internal machinery. After tibrv_Close destroys the internal machinery, Rendezvous software becomes inoperative: Events no longer arrive in queues. All events and queues are unusable, so programs can no longer dispatch events. All transports are unusable, so programs can no longer send outbound messages.
frees storage associated with events, queues, queue groups, transports and dispatcher threads. However, tibrv_Close does not destroy Rendezvous messages; the program must explicitly destroy messages to reclaim their storage.
tibrv_Close
A reference count protects against interactions between programs and third-party packages that call tibrv_Open and tibrv_Close. Each call to tibrv_Open increments an internal counter; each call to tibrv_Close decrements that counter. A call to tibrv_Open actually creates internal machinery only when the reference counter is zero; subsequent calls merely increment the counter, but do not duplicate the machinery. A call to tibrv_Close actually destroys the internal machinery only when the call decrements the counter to zero; other calls merely decrement the counter. In each program, the number of calls to tibrv_Open and tibrv_Close must match.
tibrv_Open,
See Also
page 5
tibrv_Open 5
tibrv_Open
Function Declaration
CALL tibrv_Open RETURNING TIBRV-STATUS END-CALL RVBOPEN
Create and start Rendezvous internal machinery. This call creates the internal machinery that Rendezvous software requires for its operation: Internal data structures. Default event queue. Intra-process transport. Event driver.
Until the first call to tibrv_Open creates the internal machinery, all events, queues, and transports are unusable. However, calls that manipulate messages do not require this machinery, and programs may use them before calling
tibrv_Open.
Reference Count
A reference count protects against interactions between programs and third-party packages that call tibrv_Open and tibrv_Close. Each call to tibrv_Open increments an internal counter; each call to tibrv_Close decrements that counter. A call to tibrv_Open actually creates internal machinery only when the reference counter is zero; subsequent calls merely increment the counter, but do not duplicate the machinery. A call to tibrv_Close actually destroys the internal machinery only when the call decrements the counter to zero; other calls merely decrement the counter. In each program, the number of calls to tibrv_Open and tibrv_Close must match.
tibrv_Close,
See Also
page 4
| Chapter 2
Environment
tibrv_SetCodePages
Function Declaration
CALL 'tibrv_SetCodePages' USING BY REFERENCE HOSTCODEPAGE BY REFERENCE NETCODEPAGE RETURNING TIBRV-STATUS END-CALL RVBSCP
Set code pages for automatic string conversion on EBCDIC platforms (namely, i5/OS and z/OS). Rendezvous software uses the operating systems iconv() call to automatically convert strings. This automatic conversion applies to strings within message fields, field names, subject names, and other strings associated with messages (even when they are not strictly inside a message). Conversion occurs only as needed: Programs running in EBCDIC environments represent all strings using an EBCDIC code page (called the host code page). Before inserting strings into a message object, Rendezvous software converts those strings to an ASCII character set (the network code page). Conversely, when extracting strings from a message object, Rendezvous software converts those strings to the EBCDIC host code page before presenting the strings to the program.
String Conversion
Remarks
This call sets the host and network code pages for string conversions in EBCDIC environments. On other operating system platforms, this call has no effect, and returns without error. Call this function when the system code pages differ from the Rendezvous default code pages (see the table of Default Code Pages on page 7). Throughout an enterprise, all sending and receiving programs must use the same code pages. Both arguments are string names of code pages. To determine valid code page names for your operating system, see documentation from the operating system vendor. Programs may call this function at most once. The call must precede the first call to tibrv_Open.
tibrv_SetCodePages 7
Parameter
host_codepage
Description Set this code page as the native (EBCDIC) character encoding for the host computer. Set this code page as the ASCII character set for the network. To use a default code page, programs may supply NULL for either parameter. Using the default code pages in both parameter positions has the same effect as not calling this function at all. Default Host Code Page
"00000"
net_codepage
OS Platform i5/OS
This value instructs i5/OS routines to use the system-defined default code page. z/OS
"IBM-1047" "ISO8859-1"
| Chapter 2
Environment
tibrv_Version
Function Declaration
CALL tibrv_Version RETURNING VERSION-POINTER END-CALL RVBVERSN
tibrvSecureDaemon_SetDaemonCert 9
tibrvSecureDaemon_SetDaemonCert
Function Declaration
call 'tibrvSecureDaemon_SetDaemonCert' USING BY REFERENCE daemonName BY REFERENCE daemonCert RETURNING TIBRV-STATUS END-CALL 05 TIBRV-SECURE-DAEMON-ANY-NAME 05 TIBRV-SECURE-DAEMON-ANY-CERT PIC PIC X(60) VALUE LOW-VALUES X(60) VALUE LOW-VALUES
RVSDSDC
Register trust in a secure daemon. When any program transport connects to a secure daemon, it verifies the daemons identity using SSL protocols. Certificates registered using this function identify trustworthy daemons. Programs divulge user names and passwords to daemons that present registered certificates. Parameter
daemonName
Description Register a certificate for a secure daemon with this name. For the syntax and semantics of this parameter, see Daemon Name, below. Register this public certificate. The text of this certificate must be in PEM encoding. See also Certificate on page 10.
daemonCert
Daemon Name
This string must be identical to the string you supply as the daemon argument to the transport creation call; see tibrvTransport_Create on page 195. Colon characters (:) separate the three parts.
ssl
host indicates the host computer of the secure daemon. You can specify this host
either as a network IP address, or a hostname. Omitting this part specifies the local host.
port_number specifies the port number where the secure daemon listens for SSL
connections.
TIBCO Rendezvous for z/OS COBOL Reference
10
| Chapter 2
Environment
(This syntax is similar to the syntax connecting to remote daemons, with the addition of the prefix ssl.)
TIBRV_SECURE_DAEMON_ANY_NAME.
In place of this three-part string, you can also supply the constant This form lets you register a catch-all certificate that applies to any secure daemon for which you have not explicitly registered another certificate. For example, you might use this form when several secure daemons share the same certificate.
Certificate
For important details, see CA-Signed Certificates on page 165 in TIBCO Rendezvous Administration. In place of an actual certificate, you can also supply the constant TIBRV_SECURE_DAEMON_ANY_CERT. The program accepts any certificate from the named secure daemon. For example, you might use this form when testing a secure daemon configuration, before generating any actual certificates.
Notice that the constants TIBRV_SECURE_DAEMON_ANY_NAME and TIBRV_SECURE_DAEMON_ANY_CERT each eliminate one of the two security checks before transmitting sensitive identification data to a secure daemon. We strongly discourage using both of these constants simultaneously, because that would eliminate all security checks, leaving the program vulnerable to unauthorized daemons.
tibrvSecureDaemon_SetUserCertWithKey 11
tibrvSecureDaemon_SetUserCertWithKey
Function Declaration
CALL 'tibrvSecureDaemon_SetUserCertWithKey' USING BY REFERENCE userCertWithKey BY REFERENCE password RETURNING TIBRV-STATUS END-CALL RVSDSDCWK
Register a (PEM) certificate with private key for identification to secure daemons. When any program transport connects to a secure daemon, the daemon verifies the programs identity using SSL protocols. The Rendezvous API includes two functions that achieve similar effects: This call accepts a certificate in PEM text format.
tibrvSecureDaemon_SetUserCertWithKeyBin
accepts a certificate in
Parameter
userCertWithKey
Description Register this user certificate with private key. The text of these certificates must be in PEM encoding. Use this password to decrypt the private key.
password
For important information about password security, see Security Factors on page 165 in TIBCO Rendezvous Administration.
CA-Signed Certificate
You can also supply a certificate signed by a certificate authority (CA). To use a CA-signed certificate, you must supply not only the certificate and private key, but also the CAs public certificate (or a chain of such certificates). Concatenate these items in one string. For important details, see CA-Signed Certificates on page 165 in TIBCO Rendezvous Administration. Error status code TIBRV_INVALID_FILE can indicate either disk I/O failure, or invalid certificate data, or an incorrect password.
tibrvSecureDaemon_SetUserCertWithKeyBin
Errors
See Also
on page 12
12
| Chapter 2
Environment
tibrvSecureDaemon_SetUserCertWithKeyBin
Function Declaration
CALL 'tibrvSecureDaemon_SetUserCertWithKeyBin' USING BY REFERENCE userCertWithKey BY VALUE userCertWithKey-size BY REFERENCE password RETURNING TIBRV-STATUS END-CALL RVSDSDCWB
Register a (PKCS #12) certificate with private key for identification to secure daemons. When any program transport connects to a secure daemon, the daemon verifies the programs identity using SSL protocols. The Rendezvous API includes two functions that achieve similar effects: This call accepts a certificate in PKCS #12 binary format.
tibrvSecureDaemon_SetUserCertWithKey
Remarks
format.
Parameter
userCertWithKey
Description Register this user certificate with private key. The binary data of this certificate must be in PKCS #12 format. The length (in bytes) of the certificate data. Use this password to decrypt the private key.
userCertWithKey-size password
For important information about password security, see Security Factors on page 165 in TIBCO Rendezvous Administration.
CA-Signed Certificate
You can also supply a certificate signed by a certificate authority (CA). To use a CA-signed certificate, you must supply not only the certificate and private key, but also the CAs public certificate (or a chain of such certificates). For important details, see CA-Signed Certificates on page 165 in TIBCO Rendezvous Administration. Error status code TIBRV_INVALID_FILE can indicate either disk I/O failure, or invalid certificate data, or an incorrect password.
Errors
tibrvSecureDaemon_SetUserCertWithKeyBin 13
See Also
tibrvSecureDaemon_SetUserCertWithKey
on page 11
www.rsasecurity.com/rsalabs/pkcs
14
| Chapter 2
Environment
tibrvSecureDaemon_SetUserNameWithPassword
Function Declaration
CALL 'tibrvSecureDaemon_SetUserNameWithPassword' USING BY REFERENCE userName BY REFERENCE password RETURNING TIBRV-STATUS END-CALL RVSDSDCWP
Register a user name with password for identification to secure daemons. When any program transport connects to a secure daemon, them daemon verifies the programs identity using SSL protocols. Parameter
userName
Description Register this user name for communicating with secure daemons. Register this password for communicating with secure daemons.
password
For important information about password security, see Security Factors on page 165 in TIBCO Rendezvous Administration.
| 15
Chapter 3
Messages
Messages are the central unit of information that Rendezvous programs exchange. This chapter describes messages and the functions that manipulate them.
Topics
Message Ownership and Control, page 23 Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29 Strings and Character Encodings, page 32
(Sheet 1 of 5) Function
Message Life Cycle
tibrvMsg_Create
Description
Page
57
16
| Chapter 3
Messages
(Sheet 2 of 5) Function
tibrvMsg_CreateCopy tibrvMsg_Destroy
Description Copy a message. Destroy a message; free the storage that it occupies. Detach an inbound message from Rendezvous storage; the program assumes responsibility for destroying the message. Enlarge a message by allocating additional storage. Clear a message, preparing it for re-use.
Page 58 60 61
tibrvMsg_Detach
tibrvMsg_Expand
62 96
tibrvMsg_Reset
Message Attributes
tibrvMsg_GetNumFields
Extract the number of fields in a message. Return the size of a message (in bytes). Format a message as a string.
88 65 56
tibrvMsg_GetByteSize tibrvMsg_ConvertToString
Address Attributes
tibrvMsg_GetSendSubject tibrvMsg_SetSendSubject tibrvMsg_GetReplySubject
Extract the subject from a message. Set the subject for a message. Extract the reply subject from a message. Set the reply subject for a message.
90 98 89 97
tibrvMsg_SetReplySubject
Messages 17
(Sheet 3 of 5) Function
Message Fields
tibrvMsg_AddField
Description
Page
Add a field to a message. Add Scalar Add Array Add Nested Message Add String Add Opaque Byte Sequence Add DateTime
42 45 47 49 50 51 54 66 70 72 75 77 79 83 85 86 93 95
tibrvMsg_GetField
Get a specified field from a message. Get Scalar Get Array Get Nested Message Get String Get Opaque Byte Sequence Get DateTime
tibrvMsg_GetFieldByIndex
Get a field from a message by an index. Get a specified instance of a field from a message. Remove a field from a message. Remove a specified instance of a field from a message.
tibrvMsg_GetFieldInstance
tibrvMsg_RemoveField tibrvMsg_RemoveFieldInstance
18
| Chapter 3
Messages
(Sheet 4 of 5) Function
tibrvMsg_UpdateField
Description Update a field within a message. Update Scalar Update Array Update Nested Message Update String Update Opaque Byte Sequence Update DateTime
Create a new message, and populate it with data. Extract the data from a message as a byte sequence. Extract a copy of the data from a message as a byte sequence.
59 63 64
tibrvMsg_GetAsBytes
tibrvMsg_GetAsBytesCopy
55 91
41
Types
tibrvLocalData
This type is the redefinition of all the datatypes that a Rendezvous message can contain as data in a message field.
33
Messages 19
(Sheet 5 of 5) Function
tibrvMsg
Description This type represents inbound or outbound TIBCO Rendezvous for z/OS messages. Represents dates and times. Fields hold data within messages. Programs manipulate the content of field structs using the public struct accessors of this type.
Page 36
tibrvMsgDateTime tibrvMsgField
37 40
Custom Datatypes
tibrvMsg-SetHandlers
Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes.
339
(Sheet 1 of 4) Function
tibrvLocalData
Description This type is the redefinition of all the datatypes that a Rendezvous message can contain as data in a message field. This type represents inbound or outbound TIBCO Rendezvous for z/OS messages. Represents dates and times.
Page 33
tibrvMsg
36
tibrvMsgDateTime
37
20
| Chapter 3
Messages
(Sheet 2 of 4) Function
tibrvMsgField
Description Fields hold data within messages. Programs manipulate the content of field structs using the public struct accessors of this type. Add a field to a message. Add Scalar Add Array Add Nested Message Add String Add Opaque Byte Sequence Add DateTime
Page 40
tibrvMsg_AddField
42 45 47 49 50 51 54 55 56 57 58 59 60 61
Clear references in this message. Format a message as a string. Allocate storage and initialize it as a new message. Copy a message. Create a new message, and populate it with data. Destroy a message; free the storage that it occupies. Detach an inbound message from Rendezvous storage; the program assumes responsibility for destroying the message. Enlarge a message by allocating additional storage.
tibrvMsg_CreateCopy tibrvMsg_CreateFromBytes
tibrvMsg_Destroy
tibrvMsg_Detach
tibrvMsg_Expand
62
Messages 21
(Sheet 3 of 4) Function
tibrvMsg_GetAsBytes
Description Extract the data from a message as a byte sequence. Extract a copy of the data from a message as a byte sequence. Return the size of a message (in bytes). Get the current time. Get a specified field from a message. Get Scalar Get Array Get Nested Message Get String Get Opaque Byte Sequence Get DateTime
Page 63 64 65 41 66 70 72 75 77 79 83 85 86 88 89 91
tibrvMsg_GetAsBytesCopy
tibrvMsg_GetByteSize
tibrvMsg_GetCurrentTime tibrvMsg_GetField
tibrvMsg_GetFieldByIndex
Get a field from a message by an index. Get a specified instance of a field from a message. Extract the number of fields in a message. Extract the reply subject from a message. Mark references in this message.
tibrvMsg_GetFieldInstance
tibrvMsg_GetNumFields
tibrvMsg_GetReplySubject
tibrvMsg_MarkReferences
22
| Chapter 3
Messages
(Sheet 4 of 4) Function
tibrvMsg_GetSendSubject tibrvMsg_RemoveField tibrvMsg_RemoveFieldInstance
Description Extract the subject from a message. Remove a field from a message. Remove a specified instance of a field from a message. Clear a message, preparing it for re-use. Set the reply subject for a message. Set the subject for a message. Update a field within a message. Update Scalar Update Array Update Nested Message Update String Update Opaque Byte Sequence Update DateTime
tibrvMsg_Reset
tibrvMsg-SetHandlers
Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes.
24
| Chapter 3
Messages
Scalar Snapshot
To extract the value of a scalar field, a program declares a scalar in program-owned storage, and passes its address to the get function; the get function copies a snapshot of the scalar field value from the message into program storage. The program can modify its snapshot at any time without affecting the original message. The program can update or delete the message field at any time without affecting the snapshot copy. Figure 1
Message 1 Get Field
Scalar Field
Update Field
Message
After deleting or updating the field, the snapshot copy of the scalar value remains in program storage.
Pointer Snapshot
Pointer data is a broad category, which includes arrays, strings, opaque byte sequences, XML data, and submessages. To extract the value of a pointer field, a program declares a pointer in program-owned storage, and passes its address to the get function; the get function copies a pointer to the field value into the programs pointer address. The function does not copy data into program-owned storage; the data still resides in storage associated with the message. Nonetheless, Rendezvous software protects the integrity of snapshot pointer data from subsequent changes to the message field. Figure 2 Extracting a Pointer Field
This pointer remains valid until the message is destroyed. Moreover, the array to which it points is a snapshot, which remains unchanged even if the program subsequently updates or removes the field. Pointer to Snapshot Array
Message
(Schematic diagrams in this section illustrate the general principles of snapshot semantics as they apply to pointer data of message fields. However, these diagrams do not accurately reflect the storage allocation and geometry of messages, nor do they reflect the underlying implementation of snapshots.) Rendezvous Protects Pointer Snapshots from Changes to the Message If the program removes the field from the message, then Rendezvous software protects the integrity of the snapshot data by retaining it in storage associated with the message; the programs pointer to the snapshot data remains valid until the message is destroyed, even though the data is no longer accessible through the message. If the program updates the message field (see Figure 3 on page 26), then Rendezvous software protects the integrity of the snapshot data by retaining it in storage associated with the message; the programs pointer to the snapshot data remains valid until the message is destroyed, and the programs view of the snapshot data remains unchangedeven though the get function would extract updated data from the message. These semantics apply to all pointer dataarrays, strings, opaque byte sequences, XML data, and submessages.
26
| Chapter 3
Messages
Figure 3
Message
Copy of Array 2
Update Field
Array 2
Updating the field copies Array 2 from the program into the message, without disturbing Array 1 snapshot. Subsequent Get calls extract this copy of Array 2.
Do Not Modify Pointer Snapshots Programs must treat array, string, XML and opaque pointer data as read-only snapshots, and must not modify the data to which those pointers refer. For example, it is illegal for programs to change any element in a snapshot array; it is illegal for programs to change any byte in snapshot strings, XML data or opaque byte sequences. Although Rendezvous software does not enforce this restriction, violating this rule is dangerous, and can result in erroneous program behavior. Do not attempt to modify the elements of an array snapshot, nor the bytes of a string, XML data or opaque snapshot. Figure 3 illustrates the correct way to modify the value of pointer data within a message field. Instead of directly modifying storage associated with the message, supply the new value through an update call, which replaces the whole value of the field. (Even after updating or removing the field, it is still illegal to modify the snapshot.) Although superseded snapshot data remains in storage associated with the message, it is not included when sending the message, nor when accessing message fields.
Rendezvous Protects the Message from Changes to Submessage Snapshots In contrast to other pointer data, programs may legally modify snapshot submessages (since a submessage is also a message in its own right). Field modification functions apply equally to ordinary messages and to submessage snapshots extracted using get calls. Moreover, modifying a snapshot submessage does not affect the original field in the parent message. Field modification functions protect the integrity of the parent message when updating or removing a field in a submessage snapshot, or when adding a new field to the submessage snapshot. Figure 4 illustrates this protection for parent messages. After updating a field in a snapshot submessage, subsequent get calls extract a pristine copy of the submessage from the field of the parent message, creating a second snapshot. Meanwhile, the modified snapshot submessage remains in storage owned by the parent message; it remains valid until the parent message is destroyed. (However, if the program detaches the snapshot submessage, it remains valid until the program explicitly destroys the submessage.) Figure 4
Message
Snapshot of Submsg 1
Pointer to Snapshot Submsg 1 This pointer remains valid until the message is destroyed. Subsequent calls to get the field from the snapshot submessage extract this new value.
Updated Field in Snapshot of Submsg 1 Pristine Copy of Submsg 1 Unchanged Field in Copy of Submsg 1
28
| Chapter 3
Messages
When a program repeatedly extracts snapshot references data and does not destroy the parent messages, consider using these functions to control the proliferation of references.
See Also
tibrvMsg_MarkReferences,
page 91
Regular message functions specify fields using a field name. Extended functions specify fields using a combination of a field name and a unique field identifier. To compare the speed and space characteristics of these two options, see Search Characteristics on page 30. Field Search Algorithm The functions that get message fields (including functions that update or remove fields, since these functions call get internally) all use this algorithm to find a field within a message, as specified by a field identifier and a field name. 1. Extended functions begin here. Regular functions begin at step 3. If the program supplied a non-zero field identifier, then search for the field with that identifier. On failure, continue to step 2. (If the identifier is zero, skip to step 3.) 2. If the identifier search (in step 1) fails, and the program supplied a non-NULL field name, then search for a field with that name. On failure, or if the program supplied NULL as the field name, return the status code TIBRV-NOT-FOUND. If the name search succeeds, but the actual identifier in the field is non-NULL (so it does not match the identifier supplied) then return the status code TIBRV-ID-CONFLICT. Regular functions begin here. Extended functions also begin here when the program supplied zero as the identifier (supplying zero is equivalent to not supplying a field identifier, so the behavior is equivalent to the corresponding regular function). Search for a field with the specified nameeven if that name is NULL. On failure, return the status code TIBRV-NOT-FOUND.
3.
30
| Chapter 3
Messages
If a message contains several fields with the same name, searching by name finds the first instance of the field with that name. Adding a New Field When a program uses an extended function to add a new field to a message, it can attach a field name, a field identifier, or both. If the program supplies an identifier, Rendezvous software checks that it is unique within the message; if the identifier is already in use, the operation fails and returns the status code TIBRV-ID-IN-USE. Passing Field Name and Identifiers The program can pass the field name and identifier to functions in either of two ways: All extended functions accept two separate parameters, named FIELDNAME and FIELDID.
tibrvMsg_AddField and tibrvMsg_UpdateField do not have extended functions. Instead, they accept a field parameter, which contains these two items as members within a tibrvMsgField struct. (The convenience functions that add and update fields do have extended functions.)
Search Characteristics In general, an identifier search completes in constant time. In contrast, a name search completes in linear time proportional to the number of fields in the message. Name search is quite fast for messages with 16 fields or fewer; for messages with more than 16 fields, identifier search is faster. Space Characteristics The smallest field name is a one-character string, which occupies three bytes in Rendezvous wire format. That one character yields a name space of 127 possible field names; a larger range requires additional characters. Field identifiers are 16 bits, which also occupy three bytes in Rendezvous wire format. However, those 16 bits yield a space of 65535 possible field identifiers; that range is fixed, and cannot be extended.
tibrvMsg_RemoveFieldInstance tibrvMsg_GetFieldInstance
on page 95.
on page 86.
32
| Chapter 3
Messages
All these strings use the character encoding appropriate to the ISO locale of the sender. For example, the United States is locale en_US, and uses the Latin-1 character encoding (also called ISO 8859-1). Strings are always in their native format (EBCDIC to ASCI and vice versa). When two programs exchange messages within the same locale, strings are always correct. However, when a message sender and receiver use different character encodings, the receiving program must translate between encodings as needed. Rendezvous software does not translate automatically.
tibrvLocalData 33
tibrvLocalData
Type Declaration
tibrvLocalData 10 TIBRV-LOCAL-DATA PIC X(16). 10 LOC-MSG REDEFINES TIBRV-LOCAL-DATA. 15 tibrv-msg USAGE POINTER. 15 FILLER PIC X(12). 10 LOC-STR REDEFINES TIBRV-LOCAL-DATA. 15 tibrv-str USAGE POINTER. 15 FILLER PIC X(12). 10 LOC-BUF REDEFINES TIBRV-LOCAL-DATA. 15 tibrv-buf USAGE POINTER. 15 FILLER PIC X(12). 10 LOC-ARRAY REDEFINES TIBRV-LOCAL-DATA. 15 tibrv-array USAGE POINTER. 15 FILLER PIC X(12). 10 LOC-BOOL REDEFINES TIBRV-LOCAL-DATA. 15 RD-BOOLRS PIC X. 15 RD-BOOL PIC X. 15 FILLER PIC X(14). 10 LOC-BOOLEAN REDEFINES LOC-BOOL. 15 tibrv-bl PIC 9(02) BINARY. 15 FILLER PIC X(14). 10 LOC-I8 REDEFINES TIBRV-LOCAL-DATA. 15 RD-I8RS PIC X. 15 RD-I8 PIC X. 15 FILLER PIC X(14). 10 LOCAL-I8 REDEFINES LOC-I8. 15 tibrv-i8 PIC S9(02) BINARY. 15 FILLER PIC X(14). 10 LOC-U8 REDEFINES tibrv-Local-Data. 15 FILLER PIC X. 15 RD-U8 PIC X. 15 FILLER PIC X(14). 10 LOCAL-U8 REDEFINES LOC-U8. 15 tibrv-u8 PIC 9(02) BINARY. 15 FILLER PIC X(14). 10 LOC-I16 REDEFINES tibrv-Local-Data. 15 tibrv-i16 PIC S9(04) BINARY. 15 FILLER PIC X(14). 10 LOC-U16 REDEFINES tibrv-Local-Data. 15 tibrv-u16 PIC 9(04) BINARY. 15 FILLER PIC X(14). 10 LOC-I32 REDEFINES tibrv-Local-Data. 15 tibrv-i32 PIC S9(09) BINARY. 15 FILLER PIC X(12). 10 LOC-U32 REDEFINES tibrv-Local-Data. 15 tibrv-u32 PIC 9(09) BINARY. 15 FILLER PIC X(12). 10 LOC-I64 REDEFINES tibrv-Local-Data. 15 tibrv-i64 PIC S9(18) BINARY. 15 FILLER PIC X(08). 10 LOC-U64 REDEFINES tibrv-Local-Data. 15 tibrv-u64 PIC 9(18) BINARY.
34
| Chapter 3
Messages
10
10
10
10
10
15 FILLER PIC X(08). LOC-F32 REDEFINES tibrv-Local-Data. 15 tibrv-f32 USAGE COMP-1. 15 FILLER PIC X(12). LOC-F64 REDEFINES tibrv-Local-Data. 15 tibrv-f64 USAGE COMP-2. 15 FILLER PIC X(08). LOC-IP16 REDEFINES tibrv-Local-Data. 15 tibrv-ipport16 PIC 9(04) BINARY. 15 FILLER PIC X(14). LOC-IP32 REDEFINES tibrv-Local-Data. 15 tibrv-ipaddr32 PIC 9(09) BINARY. 15 FILLER PIC X(12). LOC-DT REDEFINES tibrv-Local-Data. 15 tibrv-LocalDate. 20 tibrv-sec PIC S9(18) BINARY. 20 tibrv-nsec PIC 9(09) BINARY. 20 FILLER PIC X(04).
Purpose
This type is the redefinition of all the datatypes that a Rendezvous message can contain as data in a message field.
Accessors (Sheet 1 of 2)
Accessor
MSG STR BUF ARRAY BOOLEAN I8 U8 I16 U16 I32 U32 I64 U64
Description Rendezvous message character string; NULL-terminated; encoding depends on ISO locale opaque buffer, or XML data buffer (uncompressed) array (any valid element type) boolean 8-bit integer 8-bit unsigned integer 16-bit integer 16-bit unsigned integer 32-bit integer 32-bit unsigned integer 64-bit integer 64-bit unsigned integer
tibrvLocalData 35
Accessors (Sheet 2 of 2)
Accessor
F32 F64 IPPORT16 IPADDR32 DATE
Description 32-bit floating point number 64-bit floating point number 2-byte IP port, in network byte order 4-byte IP address, in network byte order TIBCO Rendezvous for z/OS date-time value; see tibrvMsgDateTime on page 37
See Also
36
| Chapter 3
Messages
tibrvMsg
Type Purpose
This type represents inbound or outbound TIBCO Rendezvous for z/OS messages. Programs manipulate messages using the calls in this chapter.
Remarks
tibrvMsgDateTime 37
tibrvMsgDateTime
Type Declaration
tibrvMsgDateTime. 10 SEC PIC 9(18) BINARY. 10 NSEC PIC 9(9) BINARY.
Purpose Accessors
Accessor
SEC NSEC
Description Signed 64-bit integer representing seconds. Unsigned 32-bit integer representing nanoseconds after the seconds value. This value is always non-negative, between zero and 999999999. It modifies the date in whole seconds by specifying the number of nanoseconds after that date. For example, the time 1/2 second before midnight of December 31, 1969 is -1 seconds plus 500,000,000 nanoseconds.
38
| Chapter 3
Messages
Representations
In both representations, zero denotes the epoch, 12:00 midnight, January 1st, 1970. Range limits denote the extreme value on either side of that center. Bold type indicates the primary unit of measurement for each representation.
Table 1
Date and Time Representations Representation Within COBOL programs Details Seconds as a 64-bit signed integer, plus nanoseconds as a 32-bit unsigned integer. However, in release 6, values are restricted to the range and granularity supported by Rendezvous wire format. Forcing larger or finer values into this representation produces an error. Two constants bracket the available (restricted) range of values within programs TIBRVMSG_DATETIME_SEC_MAX and TIBRVMSG_DATETIME_SEC_MIN. range in years range in seconds restricted range in seconds restricted range in milliseconds Rendezvous wire format (release 6 and earlier)
292,471,208,677 9,223,372,036,854,775,807 549,755,813,887 549,755,813,887,000
Seconds as a 40-bit signed integer, plus microseconds as a 24-bit unsigned integer. range in years range in seconds range in milliseconds
17,432 549,755,813,887 549,755,813,887,000
prints times in UTC format (also known as Zulu time or GMT). The ISO-8601 standard requires appending a Z character in this notation.
tibrvMsg_ConvertToString
uses Common Era numbering for years. This system does not include a year zero. So for example, the time 1 second before 0001-01-01 00:00:00Z would print as -0001-12-31 23:59:59Z.
tibrvMsg_ConvertToString tibrvMsg_ConvertToString
uses a proleptic Gregorian calendar. That is, when formatting dates earlier than the adoption of the Gregorian calendar, it projects the Gregorian calendar backward beyond its actual invention and adoption.
See Also
tibrvMsgDateTime 39
tibrvMsg_ConvertToString,
page 56
40
| Chapter 3
Messages
tibrvMsgField
Type Declaration
tibrvMsgField. 10 tibrvMsgName 10 tibrvMsgSize 10 tibrvMsgCount 10 FILLER 10 tibrvMsgData 10 tibrvMsgId 10 tibrvMsgType 10 FILLER
USAGE POINTER. PIC 9(09) BINARY. PIC 9(09) BINARY. PIC X(04) . PIC X(16) . PIC 9(04) BINARY. PIC X(01) . PIC X(05) .
Purpose
Fields hold data within messages. Programs manipulate the content of field structs using the public struct accessors of this type.
Accessors
Accessor
NAME
Description The fields name. NULL signifies the empty string as the field name. Field name strings use the ISO 8859-1 character encoding.
SIZE
The size of the fields data (in bytes). For array types, size reflects the size (in bytes) of one array element. For reflects the number of bytes in the string (including the NULL terminator, if present). For TIBRVMSG_OPAQUE and TIBRVMSG_XML, size reflects the number of bytes of data.
TIBRVMSG_STRING, size
COUNT
The number of values in an array field. For array types, count is the number of array elements. For example, when a field contains a array of ten 32-bit integers, its size is 4, and its count is 10.
1.
(For scalar types, strings, opaque byte sequences and XML data, count is That is, the field contains one stringnot an array of characters; one opaque valuenot an array of bytes.)
DATA ID
The fields data value. The fields identifier. Identifiers are optional, but must be unique within each message. A Rendezvous datatype token denoting the type of the fields data.
TYPE
tibrvMsg_GetCurrentTime 41
tibrvMsg_GetCurrentTime
Function Declaration
CALL 'tibrvMsg_GetCurrentTime USING BY REFERENCE dateTime RETURNING TIBRV-STATUS END-CALL CALL 'tibrvMsg_GetCurrentTimeString' USING BY REFERENCE local BY REFERENCE gmt RETURNING TIBRV-STATUS END-CALL
Get the current time. The first call produces a date-time object; for details, see tibrvMsgDateTime on page 37. The second call produces printable strings. These calls replace tibrv_CurrentDate, which became obsolete in release 8.0. Parameter
dateTime
Description The call produces a tibrvMsgDateTime structure representing the current time. If this argument is non-NULL, then it is a variable that can hold a string. The call stores a string representing the current time (in the local time zone) in that variable. If this argument is NULL, then the call leaves it unchanged.
local
gmt
If this argument is non-NULL, then it is a variable that can hold a string. The call uses tibrvMsg_ConvertToString to produce a string representing the current time (Zulu time), and stores the string in that variable. For details, see Converting Dates to Strings on page 38. If this argument is NULL, then the call leaves it unchanged.
See Also
tibrvMsgDateTime
on page 37
42
| Chapter 3
Messages
tibrvMsg_AddField
Function Declaration
CALL tibrvMsg_AddField USING BY REFERENCE MESSAGE BY REFERENCE FIELD RETURNING TIBRV-STATUS END-CALL RVBMAFLD
Add a field to a message. This function copies the data into the new message field. All related convenience functions behave similarly.
Parameters
Parameter
MESSAGE FIELD
Description Add the new field to this message. Add this field to the message.
Earlier releases of Rendezvous software allowed programs to append fields to a nested submessage under certain conditions. Starting with release 6, Rendezvous software no longer supports this special case convenience. Instead, programs must use this three-step process: 1. 2. Extract the nested submessage, using tibrvMsg_getMsg. Add the new fields to the extracted submessage, using type-specific convenience functions or this function. The field is added to a snapshot copy of the submessage, and modifies the copy rather than the original parent message. Store the modified submessage back into the field of the parent message, using tibrvMsg_UpdateMsg.
3.
Avoiding Common Mistakes
Whenever possible, we recommend storing arrays in message fields using one of the Rendezvous array types. This strategy makes the most efficient use of storage space, processor time, and network bandwidth.
tibrvMsg_AddField 43
If you must store array elements as individual fields, be careful mapping array indices to field identifiers. Zero-based arrays are common in C programs, but zero has a special meaning as a field identifierit represents the absence of an identifier. Do not map the zeroth element of an array (myArray[0]) to a field with identifier zero; it is impossible to retrieve such a field by its identifier (because it does not have one). It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
Warning: Reserved Field Name
The field name _data_ is reserved. Programs may not add fields with this name. More generally, all fields that begin with the underbar character are reserved.
Field Name Length Convenience Functions
The constant TIBRVMSG_FIELDNAME_MAX determines the longest possible field name. When the datatype of a field is determined during execution, use this general function. When you can determine the datatype of a field before compile-time, we recommend using type-specific convenience functions instead of this general function. Type-specific functions yield these advantages when adding fields: Code readability. Type checking. Accept constants and literals directly.
(Type-specific functions yield even further advantages when extracting or updating fields.) These categories of type-specific convenience functions add a new field:
Extended Functions
Add Scalar, page 45. Add Array, page 47. Add Nested Message, page 49. Add String, page 50. Add Opaque Byte Sequence, page 51. Add XML Byte Sequence, page 52. Add DateTime, page 54.
Each convenience function has two forms. The usual form specifies the field to add using a field name.
44
| Chapter 3
Messages
The extended form specifies the field to add using a field name and a field identifier.
For example, the function tibrvMsg_AddI32 is paired with the extended form tibrvMsg_AddI32Ex. Field identifiers have type tibrv_u16. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. For more information, see Adding a New Field, page 30.
Add Scalar 45
Add Scalar
Convenience Functions Declaration
CALL tibrvMsg_Addscalar_type USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_Addscalar_typeEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Add a field containing a scalar value. To define the value for the FIELDNAME use the following example format.
. 05 FIELDNAME PIC X(09) VALUE Z'FIELD-U8'.
Function Name
tibrvMsg_AddBool/(Ex) tibrvMsg_AddF32/(Ex)
Short Name RVBMABOL/RVBXABOL RVBMAF/RVBXAF RVBMAFL/RVBXAFL RVBMAB/RVBXAB RVBMASI/RVBXASI RVBMAI/RVBXAI RVBMALI/RVBXALI RVBMAUB/RVBXAUB
Type Description boolean 32-bit floating point 64-bit floating point 8-bit integer 16-bit integer 32-bit integer 64-bit integer 8-bit unsigned integer
tibrvMsg_AddF64/(Ex)
tibrv_f64
46
| Chapter 3
Messages
Function Name
tibrvMsg_AddU16/(Ex)
Type Description 16-bit unsigned integer 32-bit unsigned integer 64-bit unsigned integer 4-byte IP address 2-byte IP port
tibrvMsg_AddU32/(Ex)
tibrv_u32
RVBMAU/RVBXAU
tibrvMsg_AddU64/(Ex)
tibrv_u64
RVBMALU/RVBXALU
tibrvMsg_AddIPAddr32/(Ex)
tibrv_ipaddr32
RVBMAIPA/RVBXAIPA RVBMAPOR/RVBXAPOR
tibrvMsg_AddIPPort16/(EX)
tibrv_ipport16
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field with this value (which may be a literal or stored in a variable). The convenience function must correspond to the datatype of this value. We recommend casting the data to match the convenience function. The function copies the value into the new message field.
FIELDID
Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
Add Array 47
Add Array
Convenience Functions Declaration
CALL tibrvMsg_Addelement_typeArray USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE BY VALUE NUMELEMENTS RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_Addelement_typeArrayEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE BY VALUE NUMELEMENTS BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Purpose
Function Name
tibrvMsg_AddF32Array/ (Ex) tibrvMsg_AddF64Array/ (Ex) tibrvMsg_AddI8Array/( Ex) tibrvMsg_AddI16Array/ (Ex) tibrvMsg_AddI32Array/ (Ex) tibrvMsg_AddI64Array/ (Ex) tibrvMsg_AddU8Array/( Ex) tibrvMsg_AddU16Array/ (Ex)
Short Name RVBAAF/RVBYAF RVBAAFL/RVBYAFL RVBAAB/RVBYAB RVBAASI/RVBYASI RVBAAI/RVBYAI RVBAALI/RVBYALI RVBAAUB/RVBYAUB RVBAASU/RVBYASU
Type Description 32-bit floating point array 64-bit floating point array 8-bit integer array 16-bit integer array 32-bit integer array 64-bit integer array 8-bit unsigned integer array 16-bit unsigned integer array
tibrv_f64
tibrv_i8
tibrv_i16
tibrv_i32
tibrv_i64
tibrv_u8
tibrv_u16
48
| Chapter 3
Messages
Function Name
tibrvMsg_AddU32Array/ (Ex) tibrvMsg_AddU64Array/ (Ex)
Type Description 32-bit unsigned integer array 64-bit unsigned integer array message array string array
tibrv_u64
tibrv_Msg
char*
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field that contains this array. The convenience function must correspond to the datatype of this value. The function copies the array into the new message field.
NUMELEMENTS
When adding an array type, the program supplies the count of array elements in this parameter. Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
FIELDID
Short Name
RVBXAMSG
Add a field containing a nested submessage. This function adds only the data portion of the nested message (value); it does not include any address information or certified delivery information.
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field that contains this submessage. The function copies the data into the new field.
FIELDID
Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
50
| Chapter 3
Messages
Add String
Convenience Function Declaration
CALL tibrvMsg_AddString USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMASTR CALL tibrvMsg_AddStringEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXASTR
Add a field containing a string. The string cannot contain interior NULL bytes, because this function expects a NULL-terminated string. To add a string with interior NULL bytes, use the generic function tibrvMsg_AddField.
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field that contains this string (which may be a literal or stored in a variable). The function copies the data into the new field.
FIELDID
Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
Short Name
RVBXAOPQ
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field that contains this opaque buffer. The function copies the data into the new message field.
SIZE
When adding an opaque buffer, the program supplies the size (in bytes) of the data in this parameter. Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
FIELDID
52
| Chapter 3
Messages
Short Name
RVBXAXML
Add a field containing XML data. XML data is a byte sequence. Adding a field of type TIBRVMSG_XML compresses the bytes. Extracting data from the field uncompresses it to obtain the original byte sequence.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME VALUE
Description Add the new field to this message. Create the new field with this name. Add a new field that contains the XML data in this buffer. The function copies the data into the new message field.
SIZE
When adding XML data, the program supplies the size (in bytes) of the data in this parameter.
Parameters (Sheet 2 of 2)
Parameter
FIELDID
Description Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
54
| Chapter 3
Messages
Add DateTime
Convenience Function Declaration
CALL tibrvMsg_AddDateTime USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMADT CALL tibrvMsg_AddDateTimeEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXADT
Add a field containing a Rendezvous datetime value. Description Add the new field to this message. Create the new field with this name. Add a new field that contains this datetime value. The function copies the data into the new message field.
Parameter
MESSAGE FIELDNAME VALUE
FIELDID
Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
Example
This example code converts a time_t value to a datetime value, and adds the datetime to a message field. Programs can adapt this example as appropriate. (For corresponding code to extract a datetime value from a message field, and convert it to a time_t value, see the example at Get DateTime, page 83.)
tibrvMsgDateTime,
See Also
page 37
tibrvMsg_ClearReferences 55
tibrvMsg_ClearReferences
Function Declaration
CALL tibrvMsg_ClearReference USING BY REFERENCE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBMCREF
Clear references in this message. This function clears references back to the most recent mark. For a description and example, see tibrvMsg_MarkReferences on page 91.
Parameters
Parameter
MESSAGE
See Also
Validity of Data Extracted From Message Fields, page 24 Deleting Snapshot References, page 28
tibrvMsg_MarkReferences,
page 91
56
| Chapter 3
Messages
tibrvMsg_ConvertToString
Function Declaration
CALL tibrvMsg_ConvertToString USING BY VALUE MESSAGE BY REFERENCE STRING RETURNING TIBRV-STATUS END-CALL RVBMCSTR
Format a message as a string. Programs can use this function to obtain a string representation of the message for printing. For most datatypes, this function formats the full value of each field to the string. The datatypes TIBRVMSG_OPAQUE and TIBRVMSG_XML are exceptions; this function abbreviates the value of these fields. This function formats TIBRVMSG_IPADDR32 fields as four dot-separated decimal integers. This function formats TIBRVMSG_IPPORT16 fields as one decimal integer. For printing tibrvMsgDateTime values, see Converting Dates to Strings on page 38.
Parameters
Parameter
MESSAGE STRING
Description Format this message as a string. The program supplies a location in this parameter; the function stores a pointer to the string in that location. The function allocates storage for the string itself as part of the message; the string pointer remains valid until the message is destroyed. The program must not modify the string.
tibrvMsg_Create 57
tibrvMsg_Create
Function Declaration
CALL tibrvMsg_Create USING BY REFERENCE MESSAGE RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_CreateEx USING BY REFERENCE MESSAGE BY REFERENCE INITIALSTORAGE RETURNING TIBRV-STATUS END-CALL
RVBMCRE Allocate storage and initialize it as a new message. This function allocates storage for the new message. A program owns the messages that it creates, and must destroy them to reclaim the storage. That is, each call to this function must be paired with a call to tibrvMsg_Destroy on page 60. Programs can add address information to the message using on page 98, and tibrvMsg_SetReplySubject on page 97.
tibrvMsg_SetSendSubject
Message Size
When adding data to a message would overflow the allocated space, the message automatically expands by allocating additional storage. However, when creating messages that contain many small fields, you can optimize program performance by pre-allocating sufficient storage initially.
Parameters
Parameter
MESSAGE INITIALSTORAGE
Description The function stores a pointer to the new message in this location. Initial space (in bytes) to allocate for the message. page 60
See Also
tibrvMsg_Destroy, tibrvMsg_Expand,
page 62 page 97
tibrvMsg_SetReplySubject, tibrvMsg_SetSendSubject,
page 98
58
| Chapter 3
Messages
tibrvMsg_CreateCopy
Function Declaration
CALL tibrvMsg_CreateCopy USING BY REFERENCE MESSAGE BY REFERENCE COPY RETURNING TIBRV-STATUS END-CALL RVBMCC
Copy a message. The copy is completely independent of the original message. Pointer data in fields are independent copies of the values. This function copies only the data within the fields of the message. The copy does not include any supplementary informationfor example, address information or certified delivery information. (Programs can explicitly add supplementary information to the copy using functions such as tibrvMsg_SetSendSubject on page 98.) This function allocates the storage for the copy. The duration of the copy is independent of the original message. A program owns the messages that it creates, and must destroy them to reclaim the storage. That is, each call to this function must be paired with a call to tibrvMsg_Destroy on page 60.
Parameters
Parameter
MESSAGE COPY
Description Copy this message. The function stores a pointer to the new copy in this location.
tibrvMsg_Destroy,
See Also
page 60 page 97
tibrvMsg_SetReplySubject, tibrvMsg_SetSendSubject,
page 98
tibrvMsg_CreateFromBytes 59
tibrvMsg_CreateFromBytes
Function Declaration
CALL tibrvMsg_CreateFromBytes USING BY REFERENCE MESSAGE BY REFERENCE BYTES RETURNING TIBRV-STATUS END-CALL RVBMCFB
Create a new message, and populate it with data. This function allocates storage for the new message. The program owns the message, and must destroy it to reclaim the storage. That is, each call to this function must be paired with a call to tibrvMsg_Destroy on page 60. This function copies the bytes into the new message. Programs can add address information to the message using tibrvMsg_SetSendSubject on page 98, and tibrvMsg_ConvertToString on page 56.
Parameters
Parameter
MESSAGE
Description The program supplies a location for the new message. The function creates a new message and stores a pointer to it in that location. Fill the new message with this data. This data buffer represents the message in Rendezvous wire format, as produced by tibrvMsg_GetAsBytes or tibrvMsg_GetAsBytesCopy.
tibrvMsg_GetAsBytes,
BYTES
See Also
page 63 page 64
tibrvMsg_GetAsBytesCopy,
60
| Chapter 3
Messages
tibrvMsg_Destroy
Function Declaration
CALL tibrvMsg_Destroy USING BY VALUE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBMDES
Destroy a message; free the storage that it occupies. A program owns all messages that it creates or detaches, and must destroy them to reclaim the storage. That is, each call to tibrvMsg_Create() or tibrvMsg_Detach() must be paired with a call to this function. This function frees the storage associated with the message and its snapshot data. In most operating environments it is illegal to access freed storage. Destroying a message invalidates all pointer data (such as strings, arrays, undetached submessages, byte sequences, or XML data) previously extracted from any fields of the message. However, destroying a parent message does not affect detached submessages of the parent. It is safe for a program to exit without first destroying all messages.
Rendezvous software owns all inbound messages (unless explicitly detached). It automatically destroys its messages as the program exits the context of the callback function. It is illegal for your program to destroy a message that it does not own.
Parameter
MESSAGE
See Also
tibrvEventCallback,
tibrvMsg_Detach 61
tibrvMsg_Detach
Function Declaration
CALL tibrvMsg_Detach USING BY REFERENCE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBMDET
Detach an inbound message from Rendezvous storage; the program assumes responsibility for destroying the message. When Rendezvous software creates a message, it owns that message. This situation occurs only in the case of inbound messages presented to a data callback function; Rendezvous software destroys such messages when the callback function returns, unless the program explicitly detaches the message. After a detach operation, the program owns the message, and must explicitly destroy it to reclaim the storage. Programs can use this function to detach either an entire message, or a submessage. After detaching a submessage, the program owns that submessage, even after the destruction of the surrounding parent message.
Remarks
Warning
Programs may modify messages only with functions that add, remove or update fields. It is illegal to directly modify data storage in a message field. Detaching a message does not change this restriction. For further information, see Do Not Modify Pointer Snapshots on page 26, or more generally, Validity of Data Extracted From Message Fields on page 24.
Parameters
Parameter
MESSAGE
See Also
tibrvEventCallback,
tibrvcmEventCallback,
62
| Chapter 3
Messages
tibrvMsg_Expand
Function Declaration
CALL tibrvMsg_Expand USING BY REFERENCE MESSAGE BY VALUE ADDITIONALSTORAGE RETURNING TIBRV-STATUS END-CALL RVBMEXP
Enlarge a message by allocating additional storage. When adding data to a message would overflow the allocated space, the message automatically expands by allocating additional storage. However, reallocation (whether explicit or automatic) is a slow operation; to optimize program performance, we recommend allocating sufficient storage initially, so that reallocation is not required. In most cases, the message expands in place (without copying). In some cases, this function copies the message to a new location. In all cases, existing pointers to the message, its fields, and its field values remain valid (even after copying). If no space is available, this function returns the error code TIBRV_NO_MEMORY.
Parameters
Parameter
MESSAGE ADDITIONALSTORAGE
Description Expand this message. Enlarge the message by this amount (in bytes) to allocate for the message. If the message was oldSize bytes before this call, it is oldSize + additionalStorage when the function returns.
tibrvMsg_GetAsBytes 63
tibrvMsg_GetAsBytes
Function Declaration
CALL tibrvMsg_GetAsBytes USING BY REFERENCE MESSAGE BY REFERENCE BYTEPTR RETURNING TIBRV-STATUS END-CALL RVBMGAB
Extract the data from a message as a byte sequence. Return the data as a byte sequence, suitable for archiving in a file. The storage for the byte sequence is associated with the message, and persists until the message is destroyed. Programs must not modify the resulting byte sequence, which remains part of the message object. To make a copy that your program can modify, use tibrvMsg_GetAsBytesCopy on page 64. The byte data includes the message header and all message fields in Rendezvous wire format. It does not include address information, such as the subject and reply subject, nor certified delivery information. The byte sequence can contain interior NULL bytes.
Parameters
Parameter
MESSAGE BYTEPTR
Description Extract the data bytes from this message. The program supplies a location. The function stores a pointer to the byte sequence in that location.
tibrvMsg_GetAsBytesCopy, tibrvMsg_GetByteSize,
See Also
page 64
page 65 page 59
tibrvMsg_CreateFromBytes,
64
| Chapter 3
Messages
tibrvMsg_GetAsBytesCopy
Function Declaration
CALL tibrvMsg_GetAsBytesCopy USING BY REFERENCE MESSAGE BY REFERENCE BUF BY VALUE BYTESIZE RETURNING TIBRV-STATUS END-CALL RVBMGABC
Extract a copy of the data from a message as a byte sequence. Return the data as a byte sequence, suitable for archiving in a file. This function copies the message data into a buffer, which the program owns and may modify. The byte data includes the message header and all message fields in Rendezvous wire format. It does not include address information, such as the subject and reply subject. To allocate appropriate storage, programs determine the length of the byte sequence using tibrvMsg_GetByteSize on page 65. The byte sequence can contain interior NULL bytes.
Parameters
Parameter
MESSAGE BUF
Description Extract the data from this message. The program supplies a buffer. The function copies the byte sequence into that buffer. The size of the buffer.
tibrvMsg_GetAsBytes,
BYTESIZE
See Also
tibrvMsg_GetByteSize,
tibrvMsg_CreateFromBytes,
tibrvMsg_GetByteSize 65
tibrvMsg_GetByteSize
Function Declaration
CALL tibrvMsg_GetByteSize USING BY REFERENCE MESSAGE BY REFERENCE BYTESIZE RETURNING TIBRV-STATUS END-CALL RVBMGBS
Return the size of a message (in bytes). This measurement accounts for the actual space that the message occupies (in wire format), including its header and its fields. It does not include storage that is allocated but unused. It does not include address information, such as the subject or reply subject. Programs can use this function as part of these tasks: Measure the size of message before allocating space to store a copyas with tibrvMsg_GetAsBytesCopy. Assess throughput rates. Limit output rates (also called throttling).
Parameters
Parameter
MESSAGE BYTESIZE
Description Return the size of this message. The program supplies a location. The function stores the message size (in bytes) in that location.
tibrvMsg_GetAsBytes,
See Also
page 63 page 64
tibrvMsg_GetAsBytesCopy,
66
| Chapter 3
Messages
tibrvMsg_GetField
Function Declaration
CALL tibrvMsg_GetField USING BY VALUE MESSAGE BY VALUE FIELDNAME BY REFERENCE FIELD RETURNING TIBRV-STATUS END-CALL RVBMGFLD CALL tibrvMsg_GetFieldEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE FIELD BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXGFLD
Get a specified field from a message. Programs specify the field to retrieve using the FIELDNAME and FIELDID parameters. For details, see Field Names and Field Identifiers, page 29.
FIELD
The function takes a snapshot of the field, and stores that information in the argument, overwriting the struct supplied as an argument.
The function copies scalar data into the programs field struct. Pointer data (such as strings, arrays, submessages, opaque byte sequences, or XML data) extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. Programs can use a related function to loop through all the fields of a message. To retrieve each field by its integer index number, see tibrvMsg_GetFieldByIndex on page 85.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME
Description Get the specified field of this message. Get a field with this name.
tibrvMsg_GetField 67
Parameters (Sheet 2 of 2)
Parameter
FIELD
Description The program supplies a pointer to a tibrvMsgField struct; the function overwrites the contents of the struct with a snapshot of the information from the message field. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message.
FIELDID
Field Search Algorithm This function, and related functions that get message fields, all use this algorithm to find a field within a message, as specified by a field identifier and a field name. 1. Extended functions begin here. Regular functions begin at step 3. If the identifier is zero, skip to step 3. If the program supplied a non-zero field identifier, then search for the field with that identifier. If the search succeeds, return the field. On failure, continue to step 2. 2. If the identifier search (in step 1) fails, and the program supplied a non-NULL field name, then search for a field with that name. If the name search succeeds, and the identifier in the field is NULL, return the field. If the name search succeeds, but the actual identifier in the field is non-NULL (so it does not match the identifier supplied) then return the status code TIBRV_ID_CONFLICT. If the name search fails, or if the program supplied NULL as the field name, return the status code TIBRV_NOT_FOUND. 3. Regular functions begin here. Extended functions also begin here when the program supplied zero as the identifier (supplying zero is equivalent to not supplying a field identifier, so the behavior is equivalent to the corresponding regular function). Search for a field with the specified nameeven if that name is NULL. If the search succeeds, return the field. On failure, return the status code TIBRV_NOT_FOUND.
68
| Chapter 3
Messages
If a message contains several fields with the same name, searching by name finds the first instance of the field with that name.
Extracting Fields from a Nested Message
Earlier releases of Rendezvous software allowed programs to get fields from a nested submessage by concatenating field names. As of release 6, Rendezvous software no longer supports this special case convenience. Instead, programs must separately extract the nested submessage using tibrvMsg_GetMsg, and then get the desired fields from the submessage.
Convenience Functions In most situations, we recommend using type-specific convenience functions instead of this general function. Type-specific functions yield these advantages when extracting fields: Code readability. Type checking. Automatic type conversion.
However, we do recommend the general function in two specific situations: No convenience function exists. The program must extract the data exactly as it appears in the message, without automatic type conversion. (Convenience functions always convert extracted data to a specific type.)
These categories of type-specific convenience functions find a field and get its data: Extended Functions Each convenience function has two forms. The usual form specifies the field to get using a field name. Get Scalar, page 70. Get Array, page 72. Get Nested Message, page 75. Get String, page 77. Get Opaque Byte Sequence, page 79. Get XML Byte Sequence, page 81. Get DateTime, page 83.
tibrvMsg_GetField 69
The extended form specifies the field to get using a field name and a field identifier.
For example, the function tibrvMsg_GetI32 is paired with the extended form tibrvMsg_GetI32Exbhg. The field identifier has type tibrv_u16. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. For details, see Field Names and Field Identifiers, page 29.
See Also
page 40
70
| Chapter 3
Messages
Get Scalar
Convenience Functions Declaration
CALL tibrvMsg_Getscalar_type USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_Getscalar_typeEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Get the value of a field as a scalar value. Each convenience function in this family retrieves a field and extracts its data. If the fields type (as it exists) does not match the type of the convenience function, then the function attempts to convert the data (see Datatype Conversion on page 322). If conversion is not possible, the function returns TIBRV_CONVERSION_FAILED.
Note: . 05
The following example shows the format to define the value FIELDNAME.
FIELDNAME PIC X(09) VALUE Z'FIELD-U8'.
Functions (Sheet 1 of 2)
Function Name
tibrvMsg_GetBool/(Ex) tibrvMsg_GetF32/(Ex)
Type
tibrv_bool tibrv_f32
Type Description boolean 32-bit floating point 64-bit floating point 8-bit integer 16-bit integer 32-bit integer 64-bit integer
tibrvMsg_GetF64/(Ex)
tibrv_f64
Get Scalar 71
Functions (Sheet 2 of 2)
Function Name
tibrvMsg_GetU8/(Ex)
Type
tibrv_u8
Type Description 8-bit unsigned integer 16-bit unsigned integer 32-bit unsigned integer 64-bit unsigned integer 4-byte IP address 2-byte IP port
tibrvMsg_GetU16/(Ex)
tibrv_u16
tibrvMsg_GetU32/(Ex)
tibrv_u32
tibrvMsg_GetU64/(Ex)
tibrv_u64
tibrvMsg_GetIPAddr32/(Ex)
tibrv_ipaddr32
tibrvMsg_GetIPPort16/(Ex)
tibrv_ipport16
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Get the specified field of this message. Get a field with this name. When extracting a scalar type, the program supplies a location in this parameter, and the function copies the scalar value of the field to that location. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
FIELDID
See Also
72
| Chapter 3
Messages
Get Array
Convenience Functions Declaration
CALL tibrvMsg_Getelement_typeArray USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY REFERENCE NUMELEMENTSADDR RETURNING TIBRV-STATUS END-CALL CALLtibrvMsg_Getelement_typeArrayEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY REFERENCE NUMELEMENTSADDR BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Get the value of a field as an array. Each convenience function in this family retrieves a field and extracts its data. If the fields type (as it exists) is does not match the type of the convenience function, then the function attempts to convert the data (see Datatype Conversion on page 322). If conversion is not possible, the function returns TIBRV_CONVERSION_FAILED. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. These functions produce values that are read-only snapshots of the field data (see Pointer Snapshot on page 25). Programs must not modify elements of the value array.
Functions (Sheet 1 of 2)
Function Name
tibrvMsg_GetF32Array/(Ex)
Type Description 32-bit floating point array 64-bit floating point array 8-bit integer array
tibrvMsg_GetF64Array/(Ex)
tibrv_i64
tibrvMsg_GetI8Array/(Ex)
tibrv_i8
Get Array 73
Functions (Sheet 2 of 2)
Function Name
tibrvMsg_GetI16Array/(Ex) tibrvMsg_GetI32Array/(Ex) tibrvMsg_GetI64Array/(Ex) tibrvMsg_GetU8Array/(Ex)
Short Name / Ex Short Name RVBAGSI/RVBYGSI RVBAGI/RVBYGI RVBAGLI/RVBYGLI RVBAGUB/RVBYGUB RVBAGSU/RVBYGSU RVBAGU/RVBYGU RVBAGLU/RVBYGLU RVBMGMA/RVBMG MAX RVBMGSA/RVBMGS AX
Type Description 16-bit integer array 32-bit integer array 64-bit integer array 8-bit unsigned integer array 16-bit unsigned integer array 32-bit unsigned integer array 64-bit unsigned integer array message array string array
tibrvMsg_GetU16Array/(Ex)
tibrv_u16
tibrvMsg_GetU32Array/(Ex)
tibrv_u32
tibrvMsg_GetU64Array/(Ex)
tibrv_u64
tibrvMsg_GetMsgArray/(Ex)
tibrv_Msg
tibrvMsg_GetStringArray/( Ex)
char*
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME VALUE
Description Get the specified field of this message. Get a field with this name. When extracting an array type, the program supplies a location in this parameter, and the function stores a pointer to the array in that location. When extracting an array type, the program supplies a location in this parameter, and the function stores the number of array elements in that location.
NUMELEMENTSADDR
74
| Chapter 3
Messages
Parameters (Sheet 2 of 2)
Parameter
FIELDID
Description Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
See Also
Short Name
RVBXGMSG
Get the value of a field as a Rendezvous message. Since it is not possible to convert any other datatype to a message, the field must already contain a message. Otherwise, the function returns TIBRV-CONVERSION-FAILED. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. After extracting a submessage, a program can detach it. A detached submessage remains valid and unchanged even after the parent message is destroyed. The program must explicitly destroy the detached submessage. This function produces values that are modifiable snapshots of the field data. Programs may modify the resulting submessage by adding, removing or updating fields. However, these modifications do not change the field in the original parent message; instead, they force Rendezvous software to make a copy of the field (see Rendezvous Protects the Message from Changes to Submessage Snapshots on page 27).
Parameters (Sheet 1 of 2)
Parameter
MESSAGE
76
| Chapter 3
Messages
Parameters (Sheet 2 of 2)
Parameter
FIELDNAME SUBMESSAGE
Description Get a field with this name. The program supplies a location in this parameter, and the function stores a pointer to the submessage in that location. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
tibrvMsg_Detach,
FIELDID
See Also
page 61
Get String 77
Get String
Convenience Function Declaration
CALL tibrvMsg_GetString USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMGSTR CALL tibrvMsg_GetStringEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXGSTR
Get the value of a field as a character string. This convenience function retrieves a field and extracts its data, automatically converting it to a string. Programs can use this function to obtain a printable representation of field data. For most datatypes, this function formats the full value of the field to the output string; two types are exceptions:
TIBRVMSG-OPAQUE
This function abbreviates the value of an opaque field; for example, [472 opaque bytes]. This function abbreviates the value of an XML field; for example, [XML document: 472 bytes]. The size measures uncompressed data.
TIBRVMSG-XML
Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. This function produces values that are read-only snapshots of the field data (see Pointer Snapshot on page 25). Programs must not modify the value string.
78
| Chapter 3
Messages
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Get the specified field of this message. Get a field with this name. The program supplies a location in this parameter, and the function stores a pointer to the field value in that location. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29 Datatype Conversion, page 322
FIELDID
See Also
Short Name
RVBXGOPQ
Get the value of a field as an opaque byte sequence. This convenience function retrieves a field and extracts its data. Since it is not possible to convert any other datatype to an opaque byte sequence, the field must already contain an opaque byte sequence. Otherwise, the function returns TIBRV_CONVERSION_FAILED. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. This function produces values that are read-only snapshots of the field data (see Pointer Snapshot on page 25). Programs must not modify the value sequence.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME
Description Get the specified field of this message. Get a field with this name.
80
| Chapter 3
Messages
Parameters (Sheet 2 of 2)
Parameter
LENGTH
Description The program supplies a location in this parameter, and the function stores the length of the opaque byte sequence in that location. The program supplies a location in this parameter, and the function stores a pointer to the field value in that location. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
VALUE
FIELDID
See Also
Short Name
RVBXGXML
Get the value of a field as an XML byte sequence. This convenience function retrieves a field and extracts its data. XML data is a byte sequence. Adding a field of type TIBRVMSG_XML compresses the bytes. Extracting data from the field uncompresses it to obtain the original byte sequence. Since it is not possible to convert any other datatype to an XML byte sequence, the field must already contain an XML byte sequence. Otherwise, the function returns TIBRV_CONVERSION_FAILED. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. This function produces values that are read-only snapshots of the field data (see Pointer Snapshot on page 25). Programs must not modify the value sequence.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE
82
| Chapter 3
Messages
Parameters (Sheet 2 of 2)
Parameter
FIELDNAME LENGTH
Description Get a field with this name. The program supplies a location in this parameter, and the function stores the length of the XML byte sequence in that location. The program supplies a location in this parameter, and the function stores a pointer to the field value in that location. Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
VALUE
FIELDID
See Also
Get DateTime 83
Get DateTime
Convenience Function Declaration
CALL tibrvMsg_GetDateTime USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMGDT CALL tibrvMsg_GetDateTimeEx USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXGDT
Get the value of a field as a Rendezvous datetime value. This convenience function retrieves a field and extracts its data. Since it is not possible to convert any other datatype to a datetime value, the field must already contain a datetime. Otherwise, the function returns TIBRV-CONVERSION-FAILED. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. This function produces values that are read-only snapshots of the field data (see Pointer Snapshot on page 25). Programs must not modify the datetime value.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME VALUE
Description Get the specified field of this message. Get a field with this name. The program supplies a location in this parameter, and the function stores a pointer to the field value in that location.
84
| Chapter 3
Messages
Parameters (Sheet 2 of 2)
Parameter
FIELDID
Description Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. This example code extracts a datetime value from a message field, and converts it to a time_t value. Programs can adapt this code as appropriate. Validity of Data Extracted From Message Fields, page 24 Field Names and Field Identifiers, page 29
Example
See Also
tibrvMsg_GetFieldByIndex 85
tibrvMsg_GetFieldByIndex
Function Declaration
CALL tibrvMsg_GetFieldByIndex USING BY VALUE MESSAGE BY REFERENCE FIELD BY VALUE FIELDINDEX RETURNING TIBRV-STATUS END-CALL RVBMGFBI
Get a field from a message by an index. Programs can loop through all the fields of a message, to retrieve each field in turn using an integer index. The function copies scalar data into the programs field struct. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. Add, remove and update calls can perturb the order of fields (which, in turn, affects the results when a program gets a field by index).
Parameters
Parameter
MESSAGE FIELD
Description Get the field from this message. The program supplies a pointer to a tibrvMsgField struct; the function overwrites the contents of the struct, using information from the message field. Get the field with this index. Zero specifies the first field.
tibrvMsg_GetField,
FIELDINDEX
See Also
page 66
86
| Chapter 3
Messages
tibrvMsg_GetFieldInstance
Function Declaration
CALL tibrvMsg_GetFieldInstance USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE FIELDADDR BY VALUE INSTANCE RETURNING TIBRV-STATUS END-CALL RVBMGFI
Get a specified instance of a field from a message. When a message contains several field instances with the same field name, retrieve a specific instance by number (for example, get the ith field named foo). Programs can use this function in a loop that examines every field with a specified name. The argument 1 denotes the first instance of the named field. The function copies scalar data into the programs field struct. Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the fields value does not invalidate pointer data. When the instance argument is greater than the actual number of instances of the field in the message, this function returns the status code TIBRV_NOT_FOUND.
Release 5 Interaction
Rendezvous 5 (and earlier) did not support array datatypes. Some older programs circumvented this limitation by using several fields with the same name to simulate arrays. This work-around is no longer necessary, since release 6 (and later) supports array datatypes within message fields. The function tibrvMsg_GetFieldInstance ensures backward compatibility, so new programs can still receive and manipulate messages sent from older programs. Nonetheless, we encourage programmers to use array types as appropriate, and we discourage storing several fields with the same name in a message.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME
Description Get the specified field instance of this message. Get an instance of the field with this name.
NULL
tibrvMsg_GetFieldInstance 87
Parameters (Sheet 2 of 2)
Parameter
FIELDADDR
Description The program supplies a pointer to a tibrvMsgField struct; the function overwrites the contents of the struct, using information from the message field. Get this instance of the specified field name. The argument 1 denotes the first instance of the named field.
tibrvMsg_GetField,
INSTANCE
See Also
page 66
88
| Chapter 3
Messages
tibrvMsg_GetNumFields
Function Declaration
CALL tibrvMsg_GetNumFields USING BY VALUE MESSAGE BY REFERENCE NUMFIELDS RETURNING TIBRV-STATUS END-CALL RVBMGNF
Extract the number of fields in a message. This method counts the immediate fields of the message; it does not descend into submessages to count their fields recursively.
Parameters
Parameter
MESSAGE NUMFIELDS
Description Extract the number of fields in this message. The program supplies a location in this parameter; the function stores the number of fields in that location.
tibrvMsg_GetReplySubject 89
tibrvMsg_GetReplySubject
Function Declaration
CALL tibrvMsg_GetReplySubject USING BY VALUE MESSAGE BY REFERENCE REPLYSUBJECT RETURNING TIBRV-STATUS END-CALL RVBMGRS
Extract the reply subject from a message. The reply subject string is part of a messages address informationit is not part of the message itself. Programs must not modify the storage in which this reply subject string resides.
Parameters
Parameter
MESSAGE REPLYSUBJECT
Description Get the subject of this message. The function stores a pointer to the reply subject string in this location. The function makes a snapshot copy of the reply subject string, and supplies a pointer to that snapshot within message storage. The pointer remains valid as long as the message itself remains valid in the same location. The reply subject pointer becomes invalid if the program destroys the message, or returns from the data callback function that determines the scope of an inbound message. For more information, see Pointer Snapshot on page 25, and Deleting Snapshot References on page 28.
See Also
tibrvMsg_SetSendSubject,
page 98
90
| Chapter 3
Messages
tibrvMsg_GetSendSubject
Function Declaration
CALL tibrvMsg_GetSendSubject USING BY VALUE MESSAGE BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBMGSS
Extract the subject from a message. The subject string is part of a messages address informationit is not part of the message itself. Programs must not modify the storage in which this subject string resides.
Parameters
Parameter
MESSAGE SUBJECT
Description Get the subject of this message. The function stores a pointer to the subject string in this location. The function makes a snapshot copy of the subject string, and supplies a pointer to that snapshot within message storage. The pointer remains valid as long as the message itself remains valid in the same location. The subject pointer becomes invalid if the program destroys the message, or returns from the data callback function that determines the scope of an inbound message. For more information, see Pointer Snapshot on page 25, and Deleting Snapshot References on page 28.
See Also
tibrvMsg_SetSendSubject,
page 98
tibrvMsg_MarkReferences 91
tibrvMsg_MarkReferences
Function Declaration
CALL tibrvMsg_MarkReferences USING BY REFERENCE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBMMREF
Parameter
MESSAGE
Description Mark references in this message. Extracting pointer data from a message field creates a snapshot of that data. The snapshot remains associated with the message until the program destroys the message. However, in rare situations snapshots can accumulate within a program, causing unbounded memory growth. This function gives programs explicit control over snapshot references; by clearing references, the program declares that it no longer needs the references that arise as side effects of calls that get a message field. For example, consider a program fragment that repeatedly sends a template message, getting and updating fields within a nested submessage before each send call. Each call to extract the nested message produces a snapshot reference. By surrounding the get operation with a mark and clear pair (with the clear call occurring at any time after the get call), the program releases the reference, which helps control memory usage. Every call to tibrvMsg_MarkReferences must be paired with a call to tibrvMsg_ClearReferences. It is legal to mark references several times, as long as the program eventually clears all the marks. To understand this idea, it is helpful to think of get and mark as pushdown operations, and clear as a pop operation. Figure 5 illustrates that each clear call deletes snapshots back to the most recent mark.
Remarks
92
| Chapter 3
Messages
Figure 5
Mark 1 Array Value Snapshot 1 Mark 2 Array Value Snapshot 2 Pointer to Snapshot 2 Pointer to Snapshot 1
This pointer remains valid until the call that clears references back to mark 2 (that is, the first clear call).
Unless a program explicitly marks and clears references, references persist until the message is destroyed or reset.
See Also
Validity of Data Extracted From Message Fields, page 24 Deleting Snapshot References, page 28
tibrvMsg_ClearReferences,
page 55
tibrvMsg_RemoveField 93
tibrvMsg_RemoveField
Function Declaration
CALL tibrvMsg_RemoveField USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_RemoveFieldEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
RVBMRFLD
Remove a field from a message. Pointer data (such as strings, arrays, submessages, opaque byte sequences or XML data) previously extracted from the field remains valid even after removing the field from the message.
Parameters
Parameter
MESSAGE FIELDNAME FIELDID
Description Remove the specified field from this message. Remove the field with this name. Remove the field with this identifier. Zero is a special value that signifies no field identifier. This function uses this algorithm to find and remove a field within a message, as specified by a field identifier and a field name. 1. The extended function begins here. The regular function begins at step 3. If the program supplied a non-zero field identifier, then search for the field with that identifier. If the search succeeds, remove the field. On failure, continue to step 2. (If the identifier is zero, skip to step 3.)
94
| Chapter 3
Messages
2.
If the identifier search (in step 1) fails, and the program supplied a non-NULL field name, then search for a field with that name. If the program supplied NULL as the field name, return the status code
TIBRV-NOT-FOUND.
If the name search fails, return the status code TIBRV-NOT-FOUND. If the name search succeeds, but the actual identifier in the field is non-NULL (so it does not match the identifier supplied) then return the status code TIBRV-ID-CONFLICT. If the search succeeds, remove the field. 3. The regular function begins here. The extended function also begins here when the program supplied zero as the identifier (supplying zero is equivalent to not supplying a field identifier, so the behavior is equivalent to the regular function). Search for a field with the specified nameeven if that name is NULL. If the search succeeds, remove the field. If the search fails, return the status code TIBRV-NOT-FOUND. If a message contains several fields with the same name, searching by name removes the first instance of the field with that name.
tibrvMsg_RemoveFieldInstance 95
tibrvMsg_RemoveFieldInstance
Function Declaration
CALL tibrvMsg_RemoveFieldInstance USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE INSTANCE RETURNING TIBRV-STATUS END-CALL RVBMRFI
Remove a specified instance of a field from a message. When a message contains several field instances with the same field name, remove a specific instance by number (for example, remove the ith field named foo). Programs can use this function in a loop that examines every field with a specified name. The argument 1 denotes the first instance of the named field. If the specified instance does not exist, the function returns TIBRV_NOT_FOUND. Pointer data (such as strings, arrays, submessages, opaque byte sequences or XML data) previously extracted from the field remains valid even after removing the field from the message.
Parameters
Parameter
MESSAGE FIELDNAME INSTANCE
Description Remove the specified field from this message. Remove the field with this name. Remove this instance of the field. The argument 1 specifies the first instance of the named field.
tibrvMsg_RemoveField,
See Also
page 93
96
| Chapter 3
Messages
tibrvMsg_Reset
Function Declaration
CALL tibrvMsg_Reset USING BY REFERENCE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBMRSET
Clear a message, preparing it for re-use. This function is the equivalent of tibrvMsg_Destroy, followed immediately by tibrvMsg_Createexcept that the storage is not freed, but rather re-used. When this function returns, the message has no fields; it is like a newly created message. The messages address information is also reset. Pointer data (such as strings, arrays, submessages, opaque byte sequences or XML data) previously extracted from fields of the old message are invalid.
Parameters
Parameter
MESSAGE
See Also
page 57 page 60
tibrvMsg_Destroy,
tibrvMsg_SetReplySubject 97
tibrvMsg_SetReplySubject
Function Declaration
CALL tibrvMsg_SetReplySubject USING BY VALUE MESSAGE BY REFERENCE REPLYSUBJECT RETURNING TIBRV-STATUS END-CALL RVBMSRS
Set the reply subject for a message. Recipients of a message can use its reply subject as the address for return messages. Rendezvous routing daemons apply network address translation to inbox subjects and reply subjects (but not to inbox names stored in message data fields).
Parameters
Parameter
MESSAGE REPLYSUBJECT
Description Set the reply subject of this message. Use this string as the new reply subject. The function copies this string to the message. The empty string is not a legal subject name.
page 89
98
| Chapter 3
Messages
tibrvMsg_SetSendSubject
Function Declaration
CALL tibrvMsg_SetSendSubject USING BY REFERENCE MESSAGE BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBMSSS
Set the subject for a message. The subject of a message can describe its content, as well as its destination set. Rendezvous routing daemons apply network address translation to inbox subjects and reply subjects (but not to inbox names stored in message data fields).
Parameters
Parameter
MESSAGE SUBJECT
Description Set the subject of this message. Use this string as the new subject. The function copies this string to the message. The empty string is not a legal subject name.
page 90
tibrvMsg_UpdateField 99
tibrvMsg_UpdateField
Function Declaration
CALL tibrvMsg_UpdateField USING BY REFERENCE MESSAGE BY REFERENCE FIELD RETURNING TIBRV-STATUS END-CALL RVBMUFLD
Update a field within a message. For most programs, we recommend type-specific convenience functions instead of this generic function. However, translation engine programs can require generic tibrvMsg_UpdateField, and would use it in conjunction with generic tibrvMsg_GetField. In this paradigm, modify the field returned from tibrvMsg_GetField by replacing its value, and supply it as the field argument to tibrvMsg_UpdateField.
Remarks
This function locates a field within the message by matching the name and identifier of field. Then it updates the message field using the field argument. (Notice that the program may not supply a field object with a different field name, field identifier, or datatype.) If no existing field matches the specifications in the field argument, then this function adds the field to the message. Update convenience functions also add the field if it is not present. The type of the existing field (within the message) and the type of the updating
field argument must be identical; otherwise, the function returns the error status
code TIBRV-INVALID-TYPE. However, when updating array or vector fields, the count (number of elements) can change. Pointer data (such as strings, arrays, submessages, opaque byte sequences or XML data) previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data.
Parameters
Parameter
MESSAGE FIELD
Description Update this message. Update the existing message field using this field.
100
| Chapter 3
Messages
This function, and related functions that update message fields, all use this algorithm to find and update a field within a message, as specified by a field identifier and a field name. 1. Extended functions begin here. Regular functions begin at step 3. If the identifier is zero, skip to step 3. If the program supplied a non-zero field identifier, then search for the field with that identifier. If the search succeeds, then update that field. On failure, continue to step 2. 2. If the identifier search (in step 1) fails, and the program supplied a non-NULL field name, then search for a field with that name. If the program supplied NULL as the field name, return the status code
TIBRV-NOT-FOUND.
If the name search succeeds, but the actual identifier in the field is non-NULL (so it does not match the identifier supplied) then return the status code TIBRV-ID-CONFLICT. If the search fails, add the field as specified (with name and identifier). 3. Regular functions begin here. Extended functions also begin here when the program supplied zero as the identifier (supplying zero is equivalent to not supplying a field identifier, so the behavior is equivalent to the corresponding regular function). Search for a field with the specified nameeven if that name is NULL. If the search fails, add the field as specified (with name and identifier). If a message contains several fields with the same name, searching by name finds the first instance of the field with that name.
Warning: Reserved Field Name
The field name _data_ is reserved. Programs may not add fields with this name. (More generally, all fields that begin with the underbar character are reserved.)
Field Name Length Convenience Functions
The constant TIBRVMSG-FIELDNAME-MAX determines the longest possible field name. When the datatype of a field is determined during execution, use this general function. When you can determine the datatype of a field before compile-time, we recommend using type-specific convenience functions instead of this general function. Type-specific functions yield these advantages when updating fields:
tibrvMsg_UpdateField 101
These categories of type-specific convenience functions find a field and update its data:
Extended Functions
Update Scalar, page 102. Update Array, page 104. Update Nested Message, page 106. Update String, page 108. Update Opaque Byte Sequence, page 110 Update XML Byte Sequence, page 112 Update DateTime, page 114
Each convenience function has two forms. The usual form specifies the field to update using a field name. The extended form specifies the field to update using a field name and a field identifier.
For example, the function tibrvMsg-UpdateI32 is paired with the extended form tibrvMsg-UpdateI32Ex. The field identifier has type tibrv_u16, or PIC 9(4) BINARY. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. For details, see Field Names and Field Identifiers, page 29.
102
| Chapter 3
Messages
Update Scalar
Convenience Functions Declaration
CALL tibrvMsg_Updatescalar_type USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_Updatescalar_typeEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY VALUE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Update a field containing a scalar value. Each convenience function in this family locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match.
Functions (Sheet 1 of 2)
Function Name
tibrvMsg_UpdateBool tibrvMsg_UpdateI8 tibrvMsg_UpdateU8
Value Type
tibrv_bool tibrv_i8 tibrv_u8
Type Description boolean scalar 8-bit integer 8-bit unsigned integer 16-bit integer 16-bit unsigned integer 32-bit integer
tibrvMsg_UpdateI16 tibrvMsg_UpdateU16
tibrv_i16 tibrv_u16
tibrvMsg_UpdateI32
tibrv_i32
RVBMUI/RVXMUI
Functions (Sheet 2 of 2)
Function Name
tibrvMsg_UpdateU32
Value Type
tibrv_u32
Type Description 32-bit unsigned integer 64-bit integer 64-bit unsigned integer 32-bit floating point 64-bit floating point 4-byte IP address 2-byte IP port
tibrvMsg_UpdateI64 tibrvMsg_UpdateU64
tibrv_i64 tibrv_u64
RVBMULI/RVXMULI RVBMULU/RVXMULU
tibrvMsg_UpdateF32
tibrv_f32
tibrvMsg_UpdateF64
tibrv_f64
tibrvMsg_UpdateIPAddr32
tibrv_ipaddr32
tibrvMsg_UpdateIPPort16
tibrv_ipport16
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this value (which may be a literal or stored in a variable). The function copies the value into the new message field.
FIELDID
Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. Field Names and Field Identifiers, page 29
See Also
104
| Chapter 3
Messages
Update Array
Convenience Functions Declaration
CALL tibrvMsg_Updateelement_type USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL CALL tibrvMsg_Updateelement_typeEx USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Update a field containing an array value. Each convenience function in this family locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. The number of elements can change. Pointer data previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data. (See Pointer Snapshot on page 25.)
Functions (Sheet 1 of 2)
Function Name
tibrvMsg_UpdateI8Array/(Ex) tibrvMsg_UpdateU8Array/(Ex)
Type Description 8-bit integer array 8-bit unsigned integer array 16-bit integer array 16-bit unsigned integer array 32-bit integer array 32-bit unsigned integer array
tibrvMsg_UpdateI16Array/(Ex) tibrvMsg_UpdateU16Array/(Ex)
tibrv_i16 tibrv_u16
tibrvMsg_UpdateI32Array/(Ex) tibrvMsg_UpdateU32Array/(Ex)
tibrv_i32 tibrv_u32
Functions (Sheet 2 of 2)
Function Name
tibrvMsg_UpdateI64Array/(Ex) tibrvMsg_UpdateU64Array/(Ex)
Type Description 64-bit integer array 64-bit unsigned integer array 32-bit floating point array 64-bit floating point array message array string array
tibrvMsg_UpdateF32Array/(Ex)
tibrv_f32
tibrvMsg_UpdateF64Array/(Ex)
tibrv_f64
tibrvMsg_UpdateMsgArray/(Ex)
tibrv_Msg
tibrvMsg_UpdateStringArray/( Ex)
char*
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this array value. The function copies the new array into the existing field.
NUMELEMENTS
When updating an array type, the program supplies the count of array elements in this parameter. Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
FIELDID
See Also
106
| Chapter 3
Messages
Short Name
RVBXUMSG
Update a field containing a nested submessage. This convenience function locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. The message size (that is, its length in bytes) can change. This function uses only the data portion of the nested message (value); it does not include any address information or certified delivery information.
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this value. The function copies the new value into the field.
FIELDID
Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
See Also
108
| Chapter 3
Messages
Update String
Convenience Function Declaration
CALL tibrvMsg_UpdateString USING BY VALUE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMUSTR CALL tibrvMsg_UpdateStringEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXUSTR
Update a field containing a character string. This convenience function locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. The length of the string can change. Pointer data previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data. (See Pointer Snapshot on page 25.)
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this value (which may be a literal or stored in a variable). The function copies the new value into the existing field.
Parameters (Sheet 2 of 2)
Parameter
FIELDID
Description Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. Field Names and Field Identifiers, page 29
See Also
110
| Chapter 3
Messages
Short Name
RVBXUOPQ
Update a field containing an opaque byte sequence. This convenience function locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. The size can change. Pointer data previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data. (See Pointer Snapshot on page 25.)
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this value. The function copies the new value into the existing field.
Parameters (Sheet 2 of 2)
Parameter
SIZE
Description The program supplies the size of the new data in this parameter. Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. Field Names and Field Identifiers, page 29
FIELDID
See Also
112
| Chapter 3
Messages
Short Name
RVBXUXML
Update a field containing an XML byte sequence. This convenience function locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. The size can change. Pointer data previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data. (See Pointer Snapshot on page 25.) XML data is a byte sequence. Adding (or updating) a field of type TIBRVMSG_XML compresses the bytes. Extracting data from the field uncompresses it to obtain the original byte sequence.
Parameters (Sheet 1 of 2)
Parameter
MESSAGE FIELDNAME
Description Update the specified field of this message. Update a field with this name.
Parameters (Sheet 2 of 2)
Parameter
VALUE
Description Update the message field to this value. The function copies the new value into the existing field.
SIZE
The program supplies the size of the new data in this parameter. Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier. Field Names and Field Identifiers, page 29
FIELDID
See Also
114
| Chapter 3
Messages
Update DateTime
Convenience Function Declaration
CALL tibrvMsg_UpdateDateTime USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE RETURNING TIBRV-STATUS END-CALL RVBMUDT CALL tibrvMsg_UpdateDateTimeEx USING BY REFERENCE MESSAGE BY REFERENCE FIELDNAME BY REFERENCE VALUE BY VALUE FIELDID RETURNING TIBRV-STATUS END-CALL
Short Name
RVBXUDT
Update a field containing a datetime value. This convenience function locates a field (by name or identifier) and updates its data. The type of the existing field (within the message) and the type of the updating value must match. Pointer data previously extracted from the field remain valid and unchanged until the message is destroyed; that is, even updating the fields value does not invalidate pointer data. (See Pointer Snapshot on page 25.)
Parameters
Parameter
MESSAGE FIELDNAME VALUE
Description Update the specified field of this message. Update a field with this name. Update the message field to this value. The function copies the new value into the existing field.
FIELDID
Update the field with this identifier. Zero is a special value that signifies no field identifier. It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.
See Also
116
| Chapter 3
Messages
| 117
Chapter 4
Events
Programs can express interest in events of three kindsinbound messages, timers, and I/O conditions. When an event occurs, it triggers a program callback function to process the event. This chapter presents functions and types associated with event interest and event processing.
Topics
Operations by Functional Group, page 118 Operations in Alphabetical Order, page 120
118
| Chapter 4
Events
Description
Page
Listen for inbound messages. Start a timer. Wait for specified I/O situations to occur. Destroy an event, canceling interest. Destroy an event, and run a completion function when all of the destroyed events callback functions are complete.
Event Accessors
tibrvEvent_GetIOSource
Extract the source (socket ID) from an I/O event object. Extract the I/O type from an I/O event object. Extract the subject from a listener event object. Extract the transport from a listener event object. Extract the interval from a timer event object. Extract the type of an event object. Extract the queue of an event object. Reset the interval of a timer event object.
Description
Page
Each call to a TIBCO Rendezvous for z/OS event creation function results in a new event object, which represents your programs interest in a class of events. TIBCO Rendezvous for z/OS software uses the same event object to signal each occurrence of such an event. Programs define functions of this type to process events. A program can destroy an event object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Distinguish event objects as listeners, timers, or I/O interest. Distinguish event interest in I/O conditions.
122
tibrvEventCallback
123 124
tibrvEventOnComplete
tibrvEventType
147 148
tibrvIOType
132
120
| Chapter 4
Events
Description Each call to a TIBCO Rendezvous for z/OS event creation function results in a new event object, which represents your programs interest in a class of events. TIBCO Rendezvous for z/OS software uses the same event object to signal each occurrence of such an event. Programs define functions of this type to process events. A program can destroy an event object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Wait for specified I/O situations to occur. Listen for inbound messages. Implements an automated call-back for the listener. Start a timer. Destroy an event, canceling interest. Destroy an event, and run a completion function when all of the destroyed events callback functions are complete. Extract the source (socket ID) from an I/O event object. Extract the I/O type from an I/O event object. Extract the subject from a listener event object.
Page 122
tibrvEventCallback
123 124
tibrvEventOnComplete
tibrvEvent_GetIOSource
tibrvEvent_GetIOType tibrvEvent_GetListenerSubject
Description Extract the transport from a listener event object. Extract the interval from a timer event object. Extract the type of an event object. Extract the queue of an event object. Distinguish event objects as listeners, timers, or I/O interest. Distinguish event interest in I/O conditions.
tibrvIOType
122
| Chapter 4
Events
tibrvEvent
Type Declaration Purpose Remarks
tibrvEvent PIC 9(9) BINARY.
Event objects represent program interest in events, and event occurrences. Each call to a TIBCO Rendezvous for z/OS event creation function results in a new event object, which represents your programs interest in a class of events. TIBCO Rendezvous for z/OS software uses the same event object to signal each occurrence of such an event. Programs use the event object as a token; they cannot view or modify the object, except using accessor functions. Programs must explicitly destroy each event object. Destroying an event object cancels the programs interest in that event, and frees its storage.
tibrvEvent_Destroy,
page 136
tibrvEvent_CreateIO,
page 139 page 140 tibrvEvent_GetListenerSubject, page 141 tibrvEvent_GetListenerTransport, page 142 tibrvEvent_GetTimerInterval, page 143 tibrvEvent_GetType, page 144 tibrvEvent_GetQueue, page 145
tibrvEventCallback 123
tibrvEventCallback
Function Type Declaration
ENTRY BY BY BY tibrvEventCallback USING VALUE EVENT VALUE MESSAGE VALUE CLOSURE.
Purpose Remarks
Programs define functions of this type to process events. A single callback function type spans listener, timer and I/O events.
Parameter
EVENT
Description This parameter receives the event object. This object is identical to the object that the program created to express event interest. When the event object is a listener, the callback receives the inbound message in this parameter. If the inbound message is empty, this parameter receives a message that has no fields. When the event object is a timer or I/O event, this parameter receives NULL.
MESSAGE
CLOSURE
This parameter receives the closure data, which the program supplied in the call that created the event object.
See Also
tibrvEvent_CreateIO,
124
| Chapter 4
Events
tibrvEventOnComplete
Function Type Declaration
ENTRY tibrvEventOnComplete USING BY VALUE DESTROYEDEVENT BY VALUE CLOSURE.
Purpose
A program can destroy an event object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Parameter
DESTROYEDEVENT
Description This parameter receives the event object. This object is identical to the object that the program created to express event interest. However, by the time this function runs, the event is already destroyed; this function cannot use the event object in TIBCO Rendezvous for z/OS calls.
CLOSURE
This parameter receives the closure data, which the program supplied in the call that created the event object.
Remarks
This type of function is important in two situations: An event callback function calls tibrvEvent_DestroyEx to destroy its event, and the program must do additional processing after the rest of the callback function has completed. Several threads dispatch an event (so the event callback function can be running in several threads) and the program must do additional processing after the callback function has completed in all threads.
Upon return from tibrvEvent_DestroyEx, the destroyed events callback function can no longer begin to run. However, in each thread where the callback function is already in progress, that callback function does continue to run until complete.
tibrvEvent_DestroyEx tibrvEventOnComplete.
accepts a completion function argument of type TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed.
This completion function can run in two situations: Figure 6 on page 125 illustrates a situation in which the program calls tibrvEvent_DestroyEx while callback functions of the destroyed event are
tibrvEventOnComplete 125
in progress. When the last of those callback functions completes, TIBCO Rendezvous for z/OS software runs the completion function immediately, in the same thread as the callback function that completes last. Figure 7 on page 126 illustrates a situation in which the program calls when the destroyed events callback function is not running in any thread. In this case, tibrvEvent_DestroyEx calls the completion function before returning.
tibrvEvent_DestroyEx
Notice that in this situation, the completion function runs in the program context, instead of the usual context of a callback function. In rare instances, deadlock can occur, resulting from unintended interactions between mutex operations in the program context before the destroy call, and mutex operations in the programs completion function code. Figure 6 Completion when Callback Functions are in Progress
2. Destroy event. Event becomes invalid. No more callback functions can begin running.
Event Valid
Callback Function Running in Thread 1 Callback Function Running in Thread 2 Callback Function Running in Thread 3 Completion Function Running in Thread 2 3. All callback functions are complete. The completion function runs immediately after the last callback function returns, in the dispatch thread of that callback function.
126
| Chapter 4
Events
Event Valid
1. Destroy event. Event becomes invalid. No more callback functions can begin running. Completion Function Running in Destroy Thread
2. Notice that no callback functions are in progress when the program destroys the event. So the completion function runs in the destroy thread, immediately after the destroy function returns.
See Also
tibrvEvent_CreateIO,
page 127 page 129 tibrvEvent_CreateTimer, page 133 tibrvEvent_DestroyEx, page 137
tibrvEvent_CreateListener,
tibrvEvent_CreateIO 127
tibrvEvent_CreateIO
Function Declaration
CALL tibrvEvent_CreateIO USING BY REFERENCE EVENT BY VALUE QUEUE BY VALUE CALLBACK BY VALUE SOCKETID BY VALUE IOTYPE BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL RVBECIO
Parameter
EVENT
Description For each I/O occurrence, place this event object on the event queue. The program supplies a location, and the function stores the new event object in that location. The event object remains valid until the program explicitly destroys it.
For each I/O occurrence, place the event on this event queue. On dispatch, process the event with this callback function. Wait for I/O occurrences on this socket. Wait for I/O occurrences of this type. See tibrvIOType on page 148.
CLOSURE
The semantics of all I/O conditions depend on the z/OS operating system and event manager. TIBCO Rendezvous for z/OS software does not change those semantics.
128
| Chapter 4
Events
I/O events trigger when the operating system reports that an I/O condition on a monitored socket would succeed (that is, transfer at least one byte without blocking). Nonetheless, TIBCO Rendezvous for z/OS software cannot guarantee that a subsequent I/O call will not block. I/O conditions are not necessarily static. Event stealing can change the prevailing I/O condition before the callback function runs. TIBCO Rendezvous for z/OS software avoids most cases of event stealing by deactivating I/O events until the callback function has returned; nonetheless, it is still possible for programs to defeat this strategy. For example, consider an I/O event indicating that a particular socket is available for writing. The socket can become full before the I/O event callback function can write to that socket; in that case, a write call would indeed block. Because I/O conditions can change rapidly, we recommend that you use I/O sockets in non-blocking mode.
See Also
tibrvIOType, tibrvQueue,
tibrvEvent_CreateListener 129
tibrvEvent_CreateListener
Function Declaration
CALL tibrvEvent_CreateListener USING BY REFERENCE EVENT BY VALUE QUEUE BY VALUE CALLBACK BY VALUE TRANSPORT BY REFERENCE SUBJECT BY VALUE O RETURNING TIBRV-STATUS END-CALL RVBECLS
Description For each inbound message, place this event on the event queue. The program supplies a location, and the function stores the new event in that location. The event object remains valid until the program explicitly destroys it.
QUEUE
For each inbound message, place the event on this event queue. On dispatch, process the event with this callback function. Listen for inbound messages on this transport. Listen for inbound messages with subjects that match this specification. Wildcard subjects are permitted. The empty string is not a legal subject name.
Inbound messages on the transport that match the subject trigger the event. This function creates a listener event object, and activates the eventthat is, it begins listening for all inbound messages with matching subjects. When a message arrives, TIBCO Rendezvous for z/OS software places the event object and message on its event queue. Dispatch removes the event object from the
130
| Chapter 4
Events
queue, and runs the callback function to process the message. (To stop receiving inbound messages on the subject, destroy the event object; this action cancels all messages already queued for the listener event; see also tibrvEvent_Destroy on page 136.) Figure 8 illustrates that TIBCO Rendezvous for z/OS software does not deactivate the listener when it places new message events on the queue (in contrast to I/O events, which are temporarily deactivated). Consequently, several messages can accumulate in the queue while the callback function is processing. Figure 8 Listener Activation and Dispatch
1. Create and activate listener event. 5. Destroy listener event. Messages stop arriving.
Listener Event Active 2. Message arrives. Event enters queue. 3. Dispatch event. Event Waiting in Queue Callback Function Running Callback Function Running Callback Function Running Callback Function Running 6. Destroying listener cancels messages in the queue. 4. Callback function returns. Dispatch next event.
When the callback function is I/O-bound, messages can arrive faster than the callback function can process them, and the queue can grow unacceptably long. In applications where a delay in processing messages is unacceptable, consider dispatching from several threads to process messages concurrently.
tibrvEvent_CreateListener 131
Use this function to listen for advisory subjects. We recommend sending advisory message events to the default queue. To receive unicast (point-to-point) messages, listen to an inbox subject name. First call tibrvTransport_CreateInbox to create the unique inbox name; then call tibrvEvent_CreateListener to begin listening. Remember that other programs have no information about an inbox until the listening program uses it as a reply subject in an outbound message. See also, Inbox Names in TIBCO Rendezvous Concepts.
tibrvEvent_GetListenerSubject, tibrvTransport_CreateInbox,
See Also
132
| Chapter 4
Events
tibrvEvent_CreateListener_Cobol
Convenience Function Declaration
CALL tibrvEvent_CreateListener_Cobol USING BY REFERENCE EVENT BY VALUE QUEUE BY VALUE TRANSPORT BY REFERENCE SUBJECT BY REFERENCE MESSAGE BY VALUE 0 RETURNING TIBRV-STATUS END-CALL RVBCBEV
Implements an automated call-back for the listener. This call-back must be explicitly destroyed (using tibrvEvent_Destroy).
Parameter
EVENT QUEUE TRANSPORT SUBJECT MESSAGE
Description Specify listener for callback routine. Specify the default queue. Specify the Rendezvous transport. Specify the subject name that is to be listened for. Message pointer.
tibrvEvent_CreateTimer 133
tibrvEvent_CreateTimer
Function Declaration
CALL tibrvEvent_CreateTimer USING BY REFERENCE EVENT BY VALUE QUEUE BY VALUE CALLBACK BY VALUE INTERVAL BY VALUE 0 RETURNING TIBRV-STATUS END-CALL RVBECTM
Description At each time interval, place this event on the event queue. The program supplies a location, and the function stores the new event object in that location. The event object remains valid until the program explicitly destroys it.
At each time interval, place the event on this event queue. On dispatch, process the event with this callback function. The timer triggers its callback function at this repeating interval (in seconds).
Remarks
All timers are repeating timers. To simulate a once-only timer, code the callback function to destroy the timer. This function creates a timer event object, and activates the timer eventthat is, it requests notification from the operating system when the timers interval elapses. When the interval elapses, TIBCO Rendezvous for z/OS software places the event object on its event queue. Dispatch removes the event object from the queue, and runs the callback function to process the timer event. On dispatch, TIBCO Rendezvous for z/OS software also determines whether the next interval has already elapsed and requeues the timer event if appropriate. (To stop the cycle, destroy the event object; see tibrvEvent_Destroy on page 136.) Notice that time waiting in the event queue until dispatch can increase the effective interval of the timer. It is the programmers responsibility to ensure timely dispatch of events.
TIBCO Rendezvous for z/OS COBOL Reference
134
| Chapter 4
Events
Figure 9 illustrates a sequence of timer intervals. The number of elapsed timer intervals directly determines the number of event callbacks. At any moment the timer object appears on the event queue at most oncenot several times as multiple copies. Nonetheless, TIBCO Rendezvous for z/OS software arranges for the appropriate number of timer event callbacks based the number of intervals that have elapsed since the timer became active or reset its interval. Destroying or invalidating the timer object immediately halts the sequence of timer events. The timer object ceases to queue new events, and an event already in the queue does not result in a callback. (However, callback functions that are already running in other threads continue to completion.) Resetting the timer interval immediately interrupts the sequence of timer events and begins a new sequence, counting the new interval from that moment. The reset operation is equivalent to destroying the timer and creating a new object in its place. Figure 9 Timer Activation and Dispatch
1. Activate timer.
Timer Interval Callback Function Running Event Waiting in Queue Callback Function Running Event Waiting in Queue
3. Dispatch the event to its callback function. 4. Interval elapses. Enter queue. 5. Dispatch the event to its callback function.
Timer Granularity
Express the timer interval (in seconds) as a 64-bit floating point number. This representation allows microsecond granularity for intervals for over 100 years. The actual granularity of intervals depends on hardware and operating system constraints.
tibrvEvent_CreateTimer 135
Zero as Interval
It is recommended that user events be implemented as messages on the intra-process transport. For more information, see Intra-Process Transport and User Events in TIBCO Rendezvous Concepts.
tibrvEvent_Destroy
See Also
on page 136
136
| Chapter 4
Events
tibrvEvent_Destroy
Function Declaration
CALL tibrvEvent_Destroy USING BY VALUE EVENT RETURNING TIBRV-STATUS END-CALL RVBEDES
Destroy an event, canceling interest. Destroying an event object cancels interest in the specified event. Upon return from tibrvEvent_Destroy, the destroyed event is no longer dispatched. It is legal for an event callback function to destroy its own event argument. Destroying event interest invalidates the event object; passing the event object as an argument to subsequent API calls produces an error. Parameter
EVENT
See Also
tibrvEventOnComplete, tibrvEvent_CreateIO,
page 124 page 127 tibrvEvent_CreateListener, page 129 tibrvEvent_CreateTimer, page 133 tibrvEvent_DestroyEx, page 137
tibrvEvent_DestroyEx 137
tibrvEvent_DestroyEx
Function Declaration
CALL tibrvEvent_DestroyEx USING BY VALUE EVENT BY VALUE COMPLETIONFUNCTION RETURNING TIBRV-STATUS END-CALL RVBEDESX
Destroy an event, and run a completion function when all of the destroyed events callback functions are complete. Destroying an event object cancels interest in the specified event. Upon return from tibrvEvent_DestroyEx, the destroyed events callback function is no longer dispatched. It is legal for an event callback function to destroy its own event argument. Although tibrvEvent_DestroyEx prevents future dispatch calls from running the destroyed events callback function, that callback function might be already running in one or more threads that dispatch events from the same queue. In each thread where the callback function is already in progress, that callback function does continue to run until complete. TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed; for important details, see tibrvEventOnComplete on page 124. Destroying event interest invalidates the event object; passing the event object as an argument to subsequent API calls produces an error. Parameter
EVENT COMPLETIONFUNCTION
Remarks
Description Cancel interest in this event. TIBCO Rendezvous for z/OS software runs this function immediately after all instances of the events callback function have completed. If the events callback function is not running when the event is destroyed, the destroy call runs it before returning. If this parameter is NULL, tibrvEvent_DestroyEx does not run a completion function; instead, its behavior is the same as tibrvEvent_Destroy.
See Also
tibrvEventOnComplete, tibrvEvent_CreateIO,
138
| Chapter 4
Events
tibrvEvent_CreateListener, tibrvEvent_Destroy,
tibrvEvent_GetIOSource 139
tibrvEvent_GetIOSource
Function Declaration
CALL tibrvEvent_GetIOSource USING BY VALUE EVENT BY REFERENCE SOURCE RETURNING TIBRV-STATUS END-CALL RVBEGIS
Extract the source (socket ID) from an I/O event object. Parameter
EVENT SOURCE
Description Extract the source from this I/O event object. The program supplies a location. The function stores the source of the I/O event object in that location. page 127
See Also
tibrvEvent_CreateIO,
140
| Chapter 4
Events
tibrvEvent_GetIOType
Function Declaration
CALL tibrvEvent_GetIOType USING BY VALUE EVENT BY REFERENCE IOTYPE RETURNING TIBRV-STATUS END-CALL RVBEGIT
Description Extract the I/O type from this I/O event object. The program supplies a location. The function stores the I/O type in that location. page 127
See Also
tibrvEvent_CreateIO, tibrvIOType,
page 148
tibrvEvent_GetListenerSubject 141
tibrvEvent_GetListenerSubject
Function Declaration
CALL tibrvEvent_GetListenerSubject USING BY VALUE EVENT BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBEGLS
Description Extract the subject from this listener. The program supplies a location. The function stores the subject of the listener event object in that location. page 129
See Also
tibrvEvent_CreateListener,
142
| Chapter 4
Events
tibrvEvent_GetListenerTransport
Function Declaration
CALL tibrvEvent_GetListenerTransport USING BY VALUE EVENT BY REFERENCE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBEGLT
Description Extract the transport from this listener. The program supplies a location. The function stores the transport of the listener event object in that location. page 129
See Also
tibrvEvent_CreateListener,
tibrvEvent_GetTimerInterval 143
tibrvEvent_GetTimerInterval
Function Declaration
CALL tibrvEvent_GetTimerInterval USING BY VALUE EVENT BY REFERENCE INTERVAL RETURNING TIBRV-STATUS END-CALL RVBEGTI
Description Extract the interval from this timer. The program supplies a location. The function stores the interval of the timer event object in that location. page 133 page 146
See Also
tibrvEvent_CreateTimer,
tibrvEvent_ResetTimerInterval,
144
| Chapter 4
Events
tibrvEvent_GetType
Function Declaration
CALL tibrvEvent_GetType USING BY VALUE EVENT BY REFERENCE TYPE RETURNING TIBRV-STATUS END-CALL RVBEGTY
Description Extract the event type from this event object. The program supplies a location. The function stores the event objects type in that location. page 122 page 147
See Also
tibrvEvent,
tibrvEventType,
tibrvEvent_GetQueue 145
tibrvEvent_GetQueue
Function Declaration
CALL tibrvEvent_GetQueue USING BY VALUE EVENT BY REFERENCE QUEUE RETURNING TIBRV-STATUS END-CALL RVBEGQ
Description Extract the event queue from this event object. The program supplies a location. The function stores the event objects queue in that location. page 122 page 154
See Also
tibrvEvent, tibrvQueue,
146
| Chapter 4
Events
tibrvEvent_ResetTimerInterval
Function Declaration
CALL tibrvEvent_GetIOType USING BY VALUE EVENT BY VALUE NEWINTERVAL RETURNING TIBRV-STATUS END-CALL RVBERTI
Reset the interval of a timer event object. The timer begins counting the new interval immediately. Parameter
EVENT NEWINTERVAL
Description Reset the interval of this timer. The timer triggers its callback function at this new repeating interval (in seconds).
Timer Granularity
Express the timer interval (in seconds) as a 64-bit floating point number. This representation allows microsecond granularity for intervals up to approximately 146 years. The actual granularity of intervals depends on hardware and operating system constraints. This function can affect a timer only before or during its intervalbut not after its interval has elapsed. This function neither examines, changes nor removes an event that is already waiting in a queue for dispatch. If the next event for the timer object is already in the queue, then that event remains in the queue, representing the old interval. The change takes effect with the subsequent interval. (To circumvent this limitation, a program can destroy the old timer object and replace it with a new one.)
Limit of Effectiveness
See Also
tibrvEvent_CreateTimer,
tibrvEvent_GetTimerInterval,
tibrvEventType 147
tibrvEventType
Type Declaration Purpose
tibrvEventType PIC 9(9) BINARY.
Description An event object with this type listens for inbound messages. An event object with this type represents is a timer. An event object with this type expresses interest in an I/O condition. page 144
TIBRV-TIMER-EVENT TIBRV-IO-EVENT
See Also
tibrvEvent_GetType,
148
| Chapter 4
Events
tibrvIOType
Type Declaration
05 tibrvIOType PIC 9(2) BINARY. 88 TIBRV-IO-READ VALUE 88 TIBRV-IO-WRITE VALUE 88 TIBRV-IO-EXCEPTION VALUE
1. 2. 4.
Purpose
Description The socket is now readable. The socket is now write-available. An exceptional condition occurred on the socket. (For example, out-of-band data has arrived.) page 127 page 140
See Also
tibrvEvent_CreateIO,
tibrvEvent_GetIOType,
| 149
Chapter 5
Event Queues
Event queues organize events awaiting dispatch. Programs dispatch events to run callback functions. This chapter presents functions and types associated with event queues.
Topics
Operations by Functional Group, page 150 Operations in Alphabetical Order, page 152
150
| Chapter 5
Event Queues
Description
Page
Specify an event queue. Create an event queue. Destroy an event queue. A program can destroy a queue object even when callback functions from its events are running in one or more threads. Multi-threaded programs can define functions of this type to discover when all event callback functions in progress have completed.
Dispatch
tibrvQueue_Dispatch tibrvQueue_Poll tibrvQueue_TimedDispatch
Dispatch an event; if no event is ready, block. Dispatch an event, if possible. Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event.
Properties
tibrvQueueLimitPolicy
Specify a strategy for resolving overflow of queue limit. Extract the number of events in a queue. Extract the limit properties of a queue. Extract the name of a queue. Extract the priority of a queue. Set the limit properties of a queue. Set the name of a queue.
(Sheet 2 of 2) Function
tibrvQueue_SetPriority
Page 172
Asynchronously notify an external event manager when a TIBCO Rendezvous for z/OS event is ready for dispatch. Extract an event queue hook function. Remove the event queue hook function from a queue. Register an event queue hook function.
155
tibrvQueue_GetHook tibrvQueue_RemoveHook
tibrvQueue_SetHook
Dispatch an event.
174
152
| Chapter 5
Event Queues
Description Specify an event queue. Asynchronously notify an external event manager when a TIBCO Rendezvous for z/OS event is ready for dispatch. Specify a strategy for resolving overflow of queue limit. A program can destroy a queue object even when callback functions from its events are running in one or more threads. Multi-threaded programs can define functions of this type to discover when all event callback functions in progress have completed. Create an event queue. Destroy an event queue. Dispatch an event; if no event is ready, block. Extract the number of events in a queue. Extract an event queue hook function. Extract the limit properties of a queue. Extract the name of a queue. Extract the priority of a queue. Dispatch an event, if possible. Remove the event queue hook function from a queue. Register an event queue hook function. Set the limit properties of a queue.
tibrvQueueLimitPolicy
156 157
tibrvQueueOnComplete
tibrvQueue_Create tibrvQueue_Destroy tibrvQueue_Dispatch tibrvQueue_GetCount tibrvQueue_GetHook tibrvQueue_GetLimitPolicy tibrvQueue_GetName tibrvQueue_GetPriority tibrvQueue_Poll tibrvQueue_RemoveHook
158 159 160 161 162 163 164 165 166 167 168 169
tibrvQueue_SetHook tibrvQueue_SetLimitPolicy
Description Set the name of a queue. Set the priority of a queue. Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event. Dispatch an event.
tibrvQueue_TimedDispatch_Cobol
174
154
| Chapter 5
Event Queues
tibrvQueue
Type Declaration Purpose Default Queue
TIBRV-DEFAULT-QUEUE PIC 9(9) BINARY VALUE 1.
Specify an event queue. The constant TIBRV_DEFAULT_QUEUE represents a pre-defined queue. Programs that need only one event queue can use this default queue (instead of using tibrvQueue_Create to create one). The default queue has priority 1, can hold an unlimited number of events, and never discards an event (since it never exceeds an event limit). TIBCO Rendezvous for z/OS software places all advisories pertaining to queue overflow on the default queue. Programs cannot destroy the default queue, except as a side effect of tibrv_Close. Programs cannot change the parameters of the default queue.
See Also
tibrvQueue_Create,
page 158
tibrvQueueHook 155
tibrvQueueHook
Function Type Declaration
ENTRY tibrvQueueHook USING BY VALUE EVENTQUEUE, BY VALUE CLOSURE.
Purpose
Asynchronously notify an external event manager when a TIBCO Rendezvous for z/OS event is ready for dispatch. Some programs need to use existing event managers to dispatch TIBCO Rendezvous for z/OS events. Some event managers repeatedly poll queues for events; others require notification that an event is ready (for example, the Microsoft Windows event manager operates this way). This hook function can inform an event manager when an event enters a queue and is ready for dispatch. You can think of this function as a wake-up call to the event manager. Once awakened, the event manager dispatches TIBCO Rendezvous for z/OS events in its usual way, by calling tibrvQueue_Dispatch or tibrvQueue_TimedDispatch.
Motivation
Remarks
When coding hook functions, remember that hook functions can be called from any thread. In general, hook functions run in the thread that enqueues the event; that thread can be a program thread, or a TIBCO Rendezvous for z/OS internal thread. Parameter
EVENTQUEUE
Description This parameter receives the queue on which an event has arrived. This parameter receives closure data supplied by the program when it registered this hook function.
CLOSURE
See Also
tibrvQueue_Dispatch, tibrvQueue_GetHook,
page 160 page 162 tibrvQueue_RemoveHook, page 167 tibrvQueue_SetHook, page 168 tibrvQueue_TimedDispatch, page 173
156
| Chapter 5
Event Queues
tibrvQueueLimitPolicy
Type Declaration
05 tibrvQueueLimitPolicy PIC 9(2) 88 TIBRVQUEUE-DISCARD-NONE 88 TIBRVQUEUE-DISCARD-NEW 88 TIBRVQUEUE-DISCARD-FIRST 88 TIBRVQUEUE-DISCARD-LAST BINARY. VALUE 0. VALUE 1. VALUE 2. VALUE 3.
Purpose
Description Never discard events; use this policy when a queue has no limit on the number of events it can contain. Discard the first event in the queue (that is, the oldest event in the queue, which would otherwise be the next event to dispatch). Discard the last event in the queue (that is, the youngest event in the queue). Discard the new event (which would otherwise cause the queue to overflow its maximum events limit).
TIBRVQUEUE-DISCARD-FIRST
TIBRVQUEUE-DISCARD-LAST
TIBRVQUEUE-DISCARD-NEW
See Also
tibrvQueue_Create,
page 158
tibrvQueue_GetLimitPolicy, tibrvQueue_SetLimitPolicy,
tibrvQueueOnComplete 157
tibrvQueueOnComplete
Function Type Declaration
ENTRY tibrvQueueOnComplete BY VALUE DESTROYEDQUEUE BY VALUE CLOSURE. USING
Purpose
A program can destroy a queue object even when callback functions from its events are running in one or more threads. Multi-threaded programs can define functions of this type to discover when all event callback functions in progress have completed. Parameter
DESTROYEDQUEUE
Description This parameter receives the queue object. However, by the time this function runs, the queue is already destroyed; this function cannot use the queue object in TIBCO Rendezvous for z/OS calls.
CLOSURE
This parameter receives the closure data, which the program supplied in the call that destroyed the queue object.
Remarks
This type of function is important when several threads dispatch from the same queue, and the program must do additional processing after the callback functions have completed in all threads. Upon return from tibrvQueue_DestroyEx(), the destroyed queue can no longer dispatch events. However, in each thread where an event callback function is already in progress, that callback function does continue to run until complete.
tibrvQueue_DestroyEx() tibrvQueueOnComplete.
accepts a completion function argument of type TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed. page 159
See Also
tibrvQueue_Destroy,
158
| Chapter 5
Event Queues
tibrvQueue_Create
Function Declaration
CALL tibrvQueue_Create USING BY REFERENCE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBQCRE
Parameter
EVENTQUEUE
Description The program supplies a location, and the function stores the address of a new queue in that location. The queue remains valid until the program explicitly destroys it.
Remarks
Upon creation, new queues use these default values. Default Value
TIBRVQUEUE-DISCARD-NONE
Property
LIMITPOLICY MAXEVENTS DISCARDAMOUNT NAME PRIORITY
Set Function
tibrvQueue_SetLimitPolicy
on
page 169
tibrvQueue_SetName
on page 171 on
tibrvQueue_SetPriority
page 172
tibrvQueue_Destroy 159
tibrvQueue_Destroy
Function Declaration
CALL tibrvQueue_Destroy USING BY VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBQDES CALL tibrvQueue_DestroyEx USING BY VALUE EVENTQUEUE By VALUE COMPLETIONFN BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL
Short Name
RVBQDESX
Destroy an event queue. When a queue is destroyed, events that remain in the queue are discarded. When a program destroys a queue, all events associated with the queue become invalid. These invalid events still occupy storage until the program explicitly destroys them, or until the program calls tibrv_Close. Parameter
EVENTQUEUE COMPLETIONFN
Description Destroy this queue. TIBCO Rendezvous for z/OS software runs this function immediately after all event callback functions dispatched from the queue have completed. If no event callback functions are running when the queue is destroyed, the destroy call runs the completion function before returning. If this parameter is NULL, tibrvQueue_DestroyEx() does not run a completion function; instead, its behavior is the same as tibrvQueue_Destroy.
CLOSURE
See Also
tibrvQueueOnComplete,
160
| Chapter 5
Event Queues
tibrvQueue_Dispatch
Macro Declaration
CALL tibrvQueue_Dispatch USING BY VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBQDSP
Dispatch an event; if no event is ready, block. If the queue is not empty, then this call dispatches the event at the head of the queue, and then returns. If the queue is empty, then this call blocks indefinitely while waiting for the queue to receive an event. Parameter
EVENTQUEUE
Description Dispatch an event from the head of this queue. page 166 page 173
See Also
tibrvQueue_Poll,
tibrvQueue_TimedDispatch,
tibrvQueue_GetCount 161
tibrvQueue_GetCount
Function Declaration
CALL tibrvQueue_GetCount USING BY VALUE EVENTQUEUE BY REFERENCE NUMEVENTS RETURNING TIBRV-STATUS END-CALL RVBQGCT
Description Extract the current event count of this queue. The program supplies a location, and the function stores (a snapshot of) the event count of the queue in that location.
162
| Chapter 5
Event Queues
tibrvQueue_GetHook
Function Declaration
CALL tibrvQueue_GetHook USING BY VALUE EVENTQUEUE By VALUE EVENTQUEUEHOOK RETURNING TIBRV-STATUS END-CALL RVBQGHK
Description Get the hook function from this queue. The program supplies a location. The function stores the hook function in that location.
See Also
tibrvQueueHook,
tibrvQueue_GetLimitPolicy 163
tibrvQueue_GetLimitPolicy
Function Declaration
CALL tibrvQueue_GetLimitPolicy USING BY VALUE EVENTQUEUE BY REFERENCE POLICY BY REFERENCE MAXEVENTS BY REFERENCE DISCARDAMOUNT RETURNING TIBRV-STATUS END-CALL RVBQGLP
Description Extract the limit information from this queue. Each queue has a policy for discarding events when a new event would cause the queue to exceed its maxEvents limit. For an explanation of the policy values, see tibrvQueueLimitPolicy on page 156. The program supplies a location, and the function stores the limit policy of the queue in that location.
MAXEVENTS
Programs can limit the number of events that a queue can holdeither to curb queue growth, or implement a specialized dispatch semantics. Zero specifies an unlimited number of events. The program supplies a location, and the function stores the maximum event limit of the queue in that location.
DISCARDAMOUNT
When the queue exceeds its maximum event limit, discard a block of events. This property specifies the number of events to discard. The program supplies a location, and the function stores the discard amount of the queue in that location.
See Also
tibrvQueueLimitPolicy, tibrvQueue_Create,
page 156 page 158 tibrvQueue_SetLimitPolicy, page 169 QUEUE.LIMIT_EXCEEDED in TIBCO Rendezvous Concepts
164
| Chapter 5
Event Queues
tibrvQueue_GetName
Function Declaration
CALL tibrvQueue_GetName USING BY VALUE EVENTQUEUE BY REFERENCE QUEUENAME RETURNING TIBRV-STATUS END-CALL RVBMQGNM
Extract the name of a queue. Queue names assist programmers and administrators in troubleshooting queues. When TIBCO Rendezvous for z/OS software delivers an advisory message pertaining to a queue, it includes the queues name; administrators can use queue names to identify specific queues within a program. The default name of every queue is tibrvQueue. We strongly recommend that you relabel each queue with a distinct and informative name, for use in debugging. Parameter
EVENTQUEUE QUEUENAME
Description Extract the name of this queue. The program supplies a location, and the function places in that location a string pointer to the queue name. The program must not modify the string.
See Also
tibrvQueue_Create,
tibrvQueue_SetName,
tibrvQueue_GetPriority 165
tibrvQueue_GetPriority
Function Declaration
CALL tibrvQueue_GetPriority USING BY VALUE EVENTQUEUE BY REFERENCE PRIORITY RETURNING TIBRV-STATUS END-CALL RVBQGPR
Extract the priority of a queue. Each queue has a single priority value, which controls its dispatch precedence within queue groups. Higher values dispatch before lower values; queues with equal priority values dispatch in round-robin fashion. Parameter
EVENTQUEUE PRIORITY
Description Extract the priority of this queue. The program supplies a location, and the function copies the priority of the queue into that location. page 158 page 172
See Also
tibrvQueue_Create,
tibrvQueue_SetPriority,
166
| Chapter 5
Event Queues
tibrvQueue_Poll
Macro Declaration
CALL tibrvQueue_Poll USING BY VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBQPOL
Dispatch an event, if possible. If the queue is not empty, then this call dispatches the event at the head of the queue, and then returns. If the queue is empty, then this call returns immediately. When the call dispatches an event, it returns the status code TIBRV-OK. When the call does not dispatch an event, it returns the status code TIBRV-TIMEOUT. Parameter
EVENTQUEUE
Description Dispatch an event from the head of this queue. page 160 page 173
See Also
tibrvQueue_Dispatch,
tibrvQueue_TimedDispatch,
tibrvQueue_RemoveHook 167
tibrvQueue_RemoveHook
Function Declaration
CALL tibrvQueue_RemoveHook USING BY VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBQRHK
See Also
tibrvQueueHook,
168
| Chapter 5
Event Queues
tibrvQueue_SetHook
Function Declaration
CALL tibrvQueue_SetHook USING BY VALUE EVENTQUEUE By VALUE EVENTQUEUEHOOK BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL RVBQSHK
Description Attach the hook function to this queue. Call this hook function whenever an event arrives on the queue. Pass this closure data to the hook function.
CLOSURE
See Also
tibrvQueueHook,
tibrvQueue_SetLimitPolicy 169
tibrvQueue_SetLimitPolicy
Function Declaration
CALL tibrvQueue_SetLimitPolicy USING BY VALUE EVENTQUEUE BY VALUE POLICY BY VALUE MAXEVENTS BY VALUE DISCARDAMOUNT RETURNING TIBRV-STATUS END-CALL RVBQSLP
Set the limit properties of a queue. This function simultaneously sets three related properties, which together describe the behavior of a queue in overflow situations. Each call must explicitly specify all three properties. (Sheet 1 of 2) Parameter
EVENTQUEUE POLICY
Description Set the limit properties of this queue. Each queue has a policy for discarding events when a new event would cause the queue to exceed its MAXEVENTS limit. Choose from the values of tibrvQueueLimitPolicy on page 156. When MAXEVENTS is zero (unlimited), the policy must be
TIBRVQUEUE-DISCARD-NONE.
The program supplies a value, and the function sets the limit policy of the queue to that value.
MAXEVENTS
Programs can limit the number of events that a queue can holdeither to curb queue growth, or implement a specialized dispatch semantics. Zero specifies an unlimited number of events; in this case, the policy must be TIBRVQUEUE-DISCARD-NONE. The program supplies a value, and the function sets the maximum event limit of the queue to that value.
170
| Chapter 5
Event Queues
(Sheet 2 of 2) Parameter
DISCARDAMOUNT
Description When the queue exceeds its maximum event limit, discard a block of events. This property specifies the number of events to discard. When DISCARDAMOUNT is zero, the policy must be TIBRVQUEUE-DISCARD-NONE. The program supplies a value, and the function sets the discard amount of the queue to that value.
See Also
tibrvQueue_GetLimitPolicy,
page 163
tibrvQueue_SetName 171
tibrvQueue_SetName
Function Declaration
CALL tibrvQueue_SetName USING BY VALUE EVENTQUEUE BY REFERENCE QUEUENAME RETURNING TIBRV-STATUS END-CALL RVBQSNM
Set the name of a queue. Queue names assist programmers and administrators in troubleshooting queues. When TIBCO Rendezvous for z/OS software delivers an advisory message pertaining to a queue, it includes the queues name; administrators can use queue names to identify specific queues within a program. The default name of every queue is tibrvQueue. We strongly recommend that you relabel each queue with a distinct and informative name, for use in debugging. Parameter
EVENTQUEUE QUEUENAME
Description Set the name of this queue. Replace the name of the queue with this new name. It is illegal to supply NULL as the new queue name.
See Also
tibrvQueue_GetName,
page 164
172
| Chapter 5
Event Queues
tibrvQueue_SetPriority
Function Declaration
CALL tibrvQueue_SetPriority USING BY VALUE EVENTQUEUE BY VALUE PRIORITY RETURNING TIBRV-STATUS END-CALL RVBQSPR
Set the priority of a queue. Each queue has a single priority value, which controls its dispatch precedence within queue groups. Higher values dispatch before lower values; queues with equal priority values dispatch in round-robin fashion. Changing the priority of a queue affects its position in all the queue groups that contain it. Parameter
EVENTQUEUE PRIORITY
Description Set the priority of this queue. Replace the priority of the queue with this new value. The priority is a non-negative integer. Priority zero signifies the last queue to dispatch.
See Also
tibrvQueue_GetPriority,
tibrvQueueGroup_Dispatch,
tibrvQueue_TimedDispatch 173
tibrvQueue_TimedDispatch
Function Declaration
CALL tibrvQueue_TimedDispatch USING BY VALUE EVENTQUEUE By VALUE TIMEOUT RETURNING TIBRV-STATUS END-CALL RVBQTDS
Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event. If an event is already in the queue, this call dispatches it, and returns immediately. If the queue is empty, this call waits for an event to arrive. If an event arrives before the waiting time elapses, then it dispatches the event and returns. If the waiting time elapses first, then the call returns without dispatching an event. When the call dispatches an event, it returns the status code TIBRV-OK. When the call does not dispatch an event, it returns the status code TIBRV-TIMEOUT.
Parameters
Remarks
Parameter
EVENTQUEUE TIMEOUT
Description Dispatch the next event from this queue. Maximum time (in seconds) that this call can block while waiting for an event to arrive in the queue.
TIBRV-NO-WAIT
timeout).
TIBRV-WAIT-FOREVER
See Also
tibrvQueue_Dispatch, tibrvQueue_Poll,
174
| Chapter 5
Event Queues
tibrvQueue_TimedDispatch_Cobol
Convenience Function Declaration
CALL tibrvQueue_TimedDispatch_Cobol USING BY VALUE EVENTQUEUE BY VALUE TIMEOUT RETURNING TIBRV-STATUS END-CALL
Purpose Remarks
Dispatch an event. Use this function to dispatch an event if you do not want to use callbacks in your code. This is allows you to write processing logic 'in-line'. The function exits on a time out or when a message has been received. Note: This function only processes subscription messages. Timers and I/O operations are not supported. In an in-line processing scenario additional timers are not a concern because the time out is specified in the call.
Parameters
Parameter
EVENTQUEUE TIMEOUT
Description Dispatch the next event from this queue. Maximum time (in seconds) that this call can block while waiting for an event to arrive in the queue.
TIBRV-NO-WAIT
timeout).
TIBRV-WAIT-FOREVER
See Also
tibrvQueue_TimedDispatch,
page 173
| 175
Chapter 6
Queue groups add flexibility and fine-grained control to the event queue dispatch mechanism. Programs can create groups of queues and dispatch them according to their queue priorities.
Topics
Function or Type
tibrvQueueGroup tibrvQueueGroup_Add tibrvQueueGroup_Create tibrvQueueGroup_Destroy tibrvQueueGroup_Dispatch
Description Specify an event queue group. Add an event queue to a queue group. Create an event queue group. Destroy an event queue group. Dispatch an event from a queue group; if no event is ready, block. Dispatch an event from a queue group, if possible. Remove an event queue from a queue group. Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event.
176
| Chapter 6
tibrvQueueGroup
Type Declaration Purpose See Also
tibrvQueueGroup PIC 9(9) BINARY.
page 178
tibrvQueueGroup_Add 177
tibrvQueueGroup_Add
Function Declaration
CALL tibrvQueueGroup_Add USING BY VALUE EVENTQUEUEGROUP By VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBGADD
Add an event queue to a queue group. If the queue is already in the group, adding it again has no effect, and the call returns TIBRV-OK. If either the queue or the group is invalid, this function returns an error status. Parameter
EVENTQUEUEGROUP EVENTQUEUE
Description Add an event queue to this queue group. Add this event queue to a queue group.
See Also
tibrvQueue,
tibrvQueueGroup_Remove,
178
| Chapter 6
tibrvQueueGroup_Create
Function Declaration
CALL tibrvQueueGroup_Create USING BY VALUE EVENTQUEUEGROUP RETURNING TIBRV-STATUS END-CALL RVBGCRE
Description The program supplies a location, and the function stores the address of a new queue group in that location. The queue group remains valid until the program explicitly destroys it.
See Also
tibrvQueueGroup_Destroy,
page 179
tibrvQueueGroup_Destroy 179
tibrvQueueGroup_Destroy
Function Declaration
CALL tibrvQueueGroup_Destroy USING BY VALUE EVENTQUEUEGROUP RETURNING TIBRV-STATUS END-CALL RVBGDES
Destroy an event queue group. The individual queues in the group continue to exist, even though the group has been destroyed. Parameter
EVENTQUEUEGROUP
See Also
tibrvQueueGroup_Create,
180
| Chapter 6
tibrvQueueGroup_Dispatch
Macro Declaration
CALL tibrvQueueGroup_Dispatch USING BY VALUE EVENTQUEUEGROUP RETURNING TIBRV-STATUS END-CALL RVBGDISP
Dispatch an event from a queue group; if no event is ready, block. If any queue in the group contains an event, then this call searches the queues in priority order, dispatches an event from the first non-empty queue that it finds, and then returns. If all the queues are empty, then this call blocks indefinitely while waiting for any queue in the group to receive an event. When searching the group for a non-empty queue, this call searches according to the priority values of the queues. If two or more queues have identical priorities, subsequent dispatch and poll calls rotate through them in round-robin fashion. Parameter
EVENTQUEUEGROUP
Description Dispatch the next event from a queue in this group. page 181 page 183
See Also
tibrvQueueGroup_Poll,
tibrvQueueGroup_TimedDispatch,
tibrvQueueGroup_Poll 181
tibrvQueueGroup_Poll
Macro Declaration
CALL tibrvQueueGroup_Poll USING BY VALUE EVENTQUEUEGROUP RETURNING TIBRV-STATUS END-CALL RVBGPOL
Dispatch an event from a queue group, if possible. If any queue in the group contains an event, then this call searches the queues in priority order, dispatches an event from the first non-empty queue that it finds, and then returns. If all the queues are empty, then this call returns immediately. When searching the group for a non-empty queue, this call searches according to the priority values of the queues. If two or more queues have identical priorities, subsequent dispatch and poll calls rotate through them in round-robin fashion. When the call dispatches an event, it returns the status code TIBRV-OK. When the call does not dispatch an event, it returns the status code TIBRV-TIMEOUT. Parameter
EVENTQUEUEGROUP
Description Dispatch the next event from a queue in this group. page 180 page 183
See Also
tibrvQueueGroup_Dispatch,
tibrvQueueGroup_TimedDispatch,
182
| Chapter 6
tibrvQueueGroup_Remove
Function Declaration
CALL tibrvQueueGroup_Remove USING BY VALUE EVENTQUEUEGROUP By VALUE EVENTQUEUE RETURNING TIBRV-STATUS END-CALL RVBGRMV
Remove an event queue from a queue group. If the queue is not in the group, this call returns the status code TIBRV-INVALID-QUEUE. Parameter
EVENTQUEUEGROUP EVENTQUEUE
Description Remove an event queue from this queue group. Remove this event queue from a queue group.
See Also
tibrvQueue,
tibrvQueueGroup_Add,
tibrvQueueGroup_TimedDispatch 183
tibrvQueueGroup_TimedDispatch
Function Declaration
CALL tibrvQueueGroup_TimedDispatch USING BY VALUE EVENTQUEUEGROUP By VALUE TIMEOUT RETURNING TIBRV-STATUS END-CALL RVBGTDS
Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event. If any queue in the group contains an event, then this call searches the queues in priority order, dispatches an event from the first non-empty queue that it finds, and then returns. If the queue is empty, this call waits for an event to arrive in any queue. If an event arrives before the waiting time elapses, then the call searches the queues, dispatches the event, and returns. If the waiting time elapses first, then the call returns without dispatching an event. When searching the group for a non-empty queue, this call searches according to the priority values of the queues. If two or more queues have identical priorities, subsequent dispatch calls rotate through them in round-robin fashion. When the call dispatches an event, it returns the status code TIBRV-OK. When the call does not dispatch an event, it returns the status code TIBRV-TIMEOUT. Parameter
EVENTQUEUEGROUP TIMEOUT
Remarks
Description Dispatch the next event from a queue in this group. Maximum time (in seconds) that this call can block while waiting for an event to arrive in the queue group.
TIBRV_NO_WAIT (zero) indicates no blocking (immediate
timeout).
TIBRV_WAIT_FOREVER
See Also
tibrvQueue_TimedDispatch, tibrvQueueGroup_Dispatch,
184
| Chapter 6
| 185
Chapter 7
Dispatcher Thread
Every program must dispatch events. This chapter describes functions that conveniently create dispatcher threads. Programmers can use this convenience facility, or arrange for event dispatch in other ways.
Topics
Function or Type
tibrvDispatchable tibrvDispatcher tibrvDispatcher_Create tibrvDispatcher_Destroy tibrvDispatcher_GetName tibrvDispatcher_SetName
Description Specify an event queue or queue group. Specify a dispatcher thread. Create a dispatcher thread. Destroy a dispatcher thread. Extract the name of a dispatcher thread. Set the name of a dispatcher thread.
186
| Chapter 7
Dispatcher Thread
tibrvDispatchable
Type Declaration Purpose Remarks
tibrvDispatchable PIC 9(9) BINARY.
Specify an event queue or queue group. This type can refer to either kind of dispatchable objectan event queue or a queue group.
tibrvDispatcher_Create,
See Also
page 188
tibrvDispatcher 187
tibrvDispatcher
Type Declaration Purpose See Also
tibrvDispatcher PIC 9(9) BINARY.
page 188
188
| Chapter 7
Dispatcher Thread
tibrvDispatcher_Create
Function Declaration
CALL tibrvDispatcher_Create USING BY REFERENCE DISPATCHER BY VALUE DISPATCHABLE RETURNING TIBRV-STATUS END-CALL RVBRCRE CALL tibrvDispatcher_CreateEx USING BY REFERENCE DISPATCHER BY VALUE DISPATCHABLE BY VALUE IDLETIMEOUT RETURNING TIBRV-STATUS END-CALL
Short Name
RVBRCREX
Create a dispatcher thread. A dispatcher thread repeatedly dispatches a queue or queue group. Inside the thread, a loop calls tibrvQueue_TimedDispatch or tibrvQueueGroup_TimedDispatch (as appropriate to the dispatchable argument). The simple form of this function creates a dispatcher thread that loops indefinitely. The extended function creates a thread that passes the IDLETIMEOUT argument to the timed dispatch call; if the timed dispatch call returns without dispatching an event (after waiting for IDLETIMEOUT seconds), then the thread exits by calling tibrvDispatcher_Destroy. Parameter
DISPATCHER
Description The program supplies a location, and the function stores the address of the new dispatcher thread in that location. The new thread dispatches this object, which can be either a queue or a queue group.
DISPATCHABLE
tibrvDispatcher_Create 189
Parameter
IDLETIMEOUT
Description When this time period (in seconds) elapses without dispatching an event, the thread exits. The special value TIBRV-WAIT-FOREVER instructs the dispatcher to loop indefinitely; the thread does not exit until the program explicitly destroys it. The special value TIBRV-NO-WAIT instructs the dispatcher to poll until no events are ready to dispatch, then exit.
See Also
tibrvQueue_TimedDispatch,
page 173 page 183 tibrvDispatchable, page 186 tibrvDispatcher_Destroy, page 190 tibrvDispatcher_SetName, page 192 DISPATCHER.THREAD_EXITED in TIBCO Rendezvous Concepts.
tibrvQueueGroup_TimedDispatch,
190
| Chapter 7
Dispatcher Thread
tibrvDispatcher_Destroy
Function Declaration
CALL tibrvDispatcher_Destroy USING BY VALUE DISPATCHER RETURNING TIBRV-STATUS END-CALL RVBRDES
Description Destroy and exit this dispatcher thread. We do not recommend destroying a dispatcher thread within the same thread (for example, from within a listener callback running within that thread). Although it is legal to do so, we discourage this practice, because some operating systems do not properly free internal resources associated with the thread (which can result in memory growth).
See Also
tibrvDispatcher_GetName 191
tibrvDispatcher_GetName
Function Declaration
CALL tibrvDispatcher_GetName USING BY VALUE DISPATCHER BY REFERENCE DISPATCHNAME RETURNING TIBRV-STATUS END-CALL RVBRGNM
Description Get the name of this thread. The program supplies a location, and the function stores the name of the dispatcher thread in that location.
192
| Chapter 7
Dispatcher Thread
tibrvDispatcher_SetName
Function Declaration
CALL tibrvDispatcher_SetName USING BY VALUE DISPATCHER BY REFERENCE DISPATCHNAME RETURNING TIBRV-STATUS END-CALL RVBRSNM
Description Set the name of this thread. Use this name as the name of the dispatcher thread.
| 193
Chapter 8
Transport
Topics
Function or Type
tibrvTransport_Create tibrvTransport_CreateInbox tibrvTransport_Destroy tibrvTransport_GetDaemon tibrvTransport_GetDescription
Description Create a network transport. Create a unique inbox subject name. Destroy a transport. Extract the daemon parameter from a transport. Extract the program description parameter from a transport. Extract the network parameter from a transport. Extract the service parameter from a transport. Send a message. Send a reply message. Send a request message and wait for a reply. Set the program description parameter of a transport.
Page 195 198 200 201 202 203 204 205 206 207 209
194
| Chapter 8
Transport
tibrvTransport
Type Declaration Purpose Remarks
tibrvTransport PIC 9(9) BINARY.
A transport object represents a delivery mechanism for messages. A transport describes a carrier mechanism for messageswhether across a network, among processes on a single computer, or within a process. A transport also defines the delivery scope of a messagethat is, the set of possible destinations for the messages it sends. Programs must explicitly destroy each transport object. Destroying a transport object invalidates subsequent send calls on that transport, invalidates any listeners using that transport, and frees its storage.
Intra-Process Transport
Each process has exactly one intra-process transport; the call tibrv_Open automatically creates it, and arranges the constant TIBRV-PROCESS-TRANSPORT to refer to it. Programs must not destroy the intra-process transport.
tibrvTransport_Create,
See Also
page 195 page 200 tibrvTransport_Send, page 205 Transport in TIBCO Rendezvous Concepts.
tibrvTransport_Destroy,
tibrvTransport_Create 195
tibrvTransport_Create
Function Declaration
CALL tibrvTransport_Create USING BY REFERENCE TRANSPORT BY REFERENCE SERVICE BY REFERENCE NETWORK BY REFERENCE DAEMON RETURNING TIBRV-STATUS END-CALL RVBTCRE CALL tibrvTransport_CreateLicensed USING BY REFERENCE TRANSPORT BY REFERENCE SERVICE BY REFERENCE NETWORK BY REFERENCE DAEMON BY REFERENCE LICENSETICKET RETURNING TIBRV-STATUS END-CALL
Short Name
RVBTCLI
Create a network transport. These calls create only network transports. The call tibrv_Open automatically creates the intra-process transport; programs cannot create additional intra-process transports.
(Sheet 1 of 2) Parameter
TRANSPORT
Description The program supplies a location, and the function stores the new transport in that location. The transport remains valid until the program explicitly destroys it.
SERVICE
The TIBCO Rendezvous for z/OS daemon divides the network into logical partitions. Each network transport communicates on a single service; a transport can communicate only with other transports on the same service. To communicate over more than one service, a program must create more than one transportone transport for each service. You can specify the service in several ways. For details, see Service Parameter in TIBCO Rendezvous Concepts.
NULL
196
| Chapter 8
Transport
(Sheet 2 of 2) Parameter
NETWORK
Description Every network transport communicates with other transports over a single network interface. On computers with more than one network interface, the network parameter instructs the TIBCO Rendezvous for z/OS daemon to use a particular network for all outbound messages from this transport. To communicate over more than one network, programs must create more than one transport. You can specify the network in several ways. For details, see Network Primer in TIBCO Rendezvous Concepts.
NULL
DAEMON
The daemon parameter instructs tibrvTransport_Create about how and where to find the TIBCO Rendezvous for z/OS daemon and establish communication. For details, see Daemon Parameter in TIBCO Rendezvous Concepts. You can specify a daemon on a remote computer. For details, see Remote Daemon in TIBCO Rendezvous Concepts.
NULL
LICENSETICKET
Embed this special license ticket in the program. When a program creates a licensed transport, rvd does not need to read a license ticket from the license ticket file (tibrv.tkt). However, if rvd has already read a valid license ticket from the ticket file when it started, it disregards this ticket. Ordinary license tickets are not valid for this parameter.
TIBCO Rendezvous for z/OS daemon processes do the work of moving messages across a network. Every network transport must connect to a TIBCO Rendezvous for z/OS daemon. If a TIBCO Rendezvous for z/OS daemon process with a corresponding daemon parameter is already running, tibrvTransport_Create connects to it. If an appropriate TIBCO Rendezvous for z/OS local daemon is not running, tries to start it. However, tibrvTransport_Create does not attempt to start a remote daemon when none is running.
tibrvTransport_Create
If tibrvTransport_Create cannot connect to the TIBCO Rendezvous for z/OS daemon, it returns the status code TIBRV-DAEMON-NOT-CONNECTED, and does not create a transport object.
tibrvTransport_Create 197
The first time a program successfully connects to the TIBCO Rendezvous for z/OS daemon process, rvd starts the clock ticking for temporary license tickets.
Description String
As a debugging aid, we recommend setting a unique description string for each transport. Use a string that distinguishes both the application and the role of the transport within it. See tibrvTransport_SetDescription on page 209. Programs must explicitly destroy each transport object. Destroying a transport object invalidates subsequent send calls on that transport, invalidates any listeners using that transport, and frees its storage. See tibrvTransport_Destroy on page 200. Attempting to use a destroyed transport in any way is an error.
Destroying Transports
Embedded License
Specially-licensed third-party developers can use the second form of this function. To use this alternate form, a developer must first purchase a special license ticket. This call embeds the special ticket in the program, so that end-users do not need to purchase TIBCO Rendezvous for z/OS to use the program. To purchase an embedded license, contact TIBCO Software Inc.
See Also
tibrvTransport_Destroy,
page 200
198
| Chapter 8
Transport
tibrvTransport_CreateInbox
Function Declaration
CALL tibrvTransport_CreateInbox USING BY VALUE TRANSPORT BY REFERENCE SUBJECTSTRING BY VALUE SUBJECTLIMIT RETURNING TIBRV-STATUS END-CALL RVBTCIB
Create a unique inbox subject name. This function is the only legal way for programs to create inbox subject names.
Remarks
This function creates inbox names that are unique throughout the transport scope. For network transports, inbox subject names are unique across all processes within the local router domainthat is, anywhere that direct multicast contact is possible. The inbox name is not necessarily unique outside of the local router domain. For the intra-process transport, inbox names are unique across all threads of the process.
This function creates only the unique name for an inbox; it does not begin listening for messages on that subject name. To begin listening, pass the inbox name as the subject argument to tibrvEvent_CreateListener. The inbox name is only valid for use with the same transport that created it. When calling tibrvEvent_CreateListener, you must pass the same transport object that created the inbox subject name. Remember that other programs have no information about an inbox subject name until the listening program uses it as a reply subject in an outbound message. Programs can overwrite or free the SUBJECTSTRING storage at any time. Use inbox subject names for delivery to a specific destination. In the context of a network transport, an inbox destination specifies unicast (point-to-point) delivery.
tibrvTransport_CreateInbox 199
TIBCO Rendezvous for z/OS routing daemons (rvrd) translate inbox subject names that appear as the send subject or reply subject of a message. They do not translate inbox subject names within the data fields of a message.
Parameter
TRANSPORT SUBJECTSTRING
Description Create an inbox on this transport. The program supplies a string buffer, and the function stores the new inbox subject string in that buffer. The number of bytes that the program has allocated to receive the new inbox subject string.
SUBJECTLIMIT
See Also
200
| Chapter 8
Transport
tibrvTransport_Destroy
Function Declaration
CALL tibrvTransport_Destroy USING BY VALUE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBTDES
Destroy a transport. Programs must explicitly destroy each transport object. Destroying a transport achieves these effects: The transport flushes all outbound data to the TIBCO Rendezvous for z/OS daemon. This effect is especially important, and neither exiting the program nor calling tibrv_Close is sufficient to flush outbound data. The transport invalidates all its listeners. Subsequent calls that use the destroyed transport return an error status. Storage for the transport object is freed.
It is illegal to destroy the intra-process transport (TIBRV-PROCESS-TRANSPORT); attempting to destroy it produces the status code TIBRV-NOT-PERMITTED. Parameter
TRANSPORT
See Also
tibrvTransport,
tibrvTransport_Create,
tibrvTransport_GetDaemon 201
tibrvTransport_GetDaemon
Function Declaration
CALL tibrvTransport_GetDaemon USING BY VALUE TRANSPORT BY REFERENCE DAEMONSTRING RETURNING TIBRV-STATUS END-CALL RVBTGDM
Extract the daemon parameter from a transport. This function returns the daemon parameter as a NULL-terminated string. Parameter
TRANSPORT DAEMONSTRING
Description Extract the effective daemon parameter from this transport. The program supplies a location, and the function places in that location a string pointer to the daemon information. The program must not modify nor free the string.
See Also
tibrvTransport,
tibrvTransport_Create,
202
| Chapter 8
Transport
tibrvTransport_GetDescription
Function Declaration
CALL tibrvTransport_GetDescription USING BY VALUE TRANSPORT BY REFERENCE DESCRIPTION RETURNING TIBRV-STATUS END-CALL RVBTGDS
Extract the program description parameter from a transport. The description identifies your program to TIBCO Rendezvous for z/OS components. Browser administration interfaces display the description string. This function returns the description parameter as a NULL-terminated string. Parameter
TRANSPORT DESCRIPTION
Description Extract the description parameter from this transport. The program supplies a location, and the function places in that location a string pointer to the description. The program must not modify nor free the string.
See Also
tibrvTransport,
tibrvTransport_SetDescription,
tibrvTransport_GetNetwork 203
tibrvTransport_GetNetwork
Function Declaration
CALL tibrvTransport_GetNetwork USING BY VALUE TRANSPORT BY REFERENCE NETWORKSTRING RETURNING TIBRV-STATUS END-CALL RVBTGNW
Extract the network parameter from a transport. This function returns the network parameter as a NULL-terminated string. Parameter
TRANSPORT NETWORKSTRING
Description Extract the network parameter from this transport. The program supplies a location, and the function places in that location a string pointer to the network parameter. The program must not modify the string.
See Also
tibrvTransport,
tibrvTransport_Create,
204
| Chapter 8
Transport
tibrvTransport_GetService
Function Declaration
CALL tibrvTransport_GetService USING BY VALUE TRANSPORT BY REFERENCE SERVICESTRING RETURNING TIBRV-STATUS END-CALL RVBTGSRV
Extract the service parameter from a transport. This function returns the service parameter as a NULL-terminated string. Parameter
TRANSPORT SERVICESTRING
Description Extract the service parameter from this transport. The program supplies a location, and the function places in that location a string pointer to the service information. The program must not modify the string.
See Also
tibrvTransport,
tibrvTransport_Create,
tibrvTransport_Send 205
tibrvTransport_Send
Function Declaration
CALL tibrvTransport_Send USING BY VALUE TRANSPORT BY VALUE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBTSEND
See Also
tibrvMsg,
tibrvMsg_Create, tibrvTransport,
206
| Chapter 8
Transport
tibrvTransport_SendReply
Function Declaration
CALL tibrvTransport_SendReply USING BY VALUE TRANSPORT BY REFERENCE REPLYMESSAGE BY REFERENCE REQUESTMESSAGE RETURNING TIBRV-STATUS END-CALL RVBTSRP
Send a reply message. This function extracts the reply subject of an inbound request message, and sends an outbound reply message to that subject. In addition to the convenience, this call is marginally faster than using separate calls to extract the subject and send the reply. This function overwrites any existing send subject of the reply message with the reply subject of the request message. Parameter
TRANSPORT REPLYMESSAGE REQUESTMESSAGE
Description Send the reply on this transport. Send this outbound reply message. Send a reply to this inbound request message; extract its reply subject to use as the subject of the outbound reply message.
Give special attention to the order of the arguments to this function. Reversing the inbound and outbound messages can cause an infinite loop, in which the program repeatedly resends the inbound message to itself (and all other recipients).
See Also
tibrvMsg_Create, tibrvTransport,
tibrvTransport_SendRequest 207
tibrvTransport_SendRequest
Function Declaration
CALL tibrvTransport_SendRequest USING BY VALUE TRANSPORT BY REFERENCE MESSAGE BY REFERENCE REPLY BY VALUE TIMEOUT RETURNING TIBRV-STATUS END-CALL RVBTSRQ
Blocking can Stall Event Dispatch This call blocks all other activity on its program thread. If appropriate, programmers must ensure that other threads continue dispatching events on its queues.
Parameter
TRANSPORT MESSAGE REPLY
Description Send the message and receive the reply on this transport. Send this outbound message. The program supplies a location, and the function stores the inbound reply in that location. The program need not create the reply message, nor allocate space for it. However, the program must destroy the reply message, even though it did not create it.
TIMEOUT
Maximum time (in seconds) that this call can block while waiting for a reply.
TIBRV-WAIT-FOREVER
The status code TIBRV-TIMEOUT indicates that the specified time expired before receiving a reply. Programs that receive and process the request message cannot determine that the sender has blocked until a reply arrives.
208
| Chapter 8
Transport
The request message must have a valid destination subject; see tibrvMsg_SetSendSubject on page 98.
Operation
This function operates in several synchronous steps: 1. Create an inbox name, and an event that listens to it. Overwrite any existing reply subject of message with the inbox name. 2. Send the outbound message. 3. Block until the listener receives a reply; if the time limit expires before a reply arrives, return the status code TIBRV-TIMEOUT. (The reply circumvents the event queue mechanism, so it is not necessary to explicitly call dispatch methods in the program.) 4. Store the reply in the location specified by the reply parameter. 5. Return.
See Also
tibrvMsg_Create, tibrvTransport,
tibrvTransport_SetDescription 209
tibrvTransport_SetDescription
Function Declaration
CALL tibrvTransport_SendDescription USING BY VALUE TRANSPORT BY REFERENCE DESCRIPTION RETURNING TIBRV-STATUS END-CALL RVBTSDS
Set the program description parameter of a transport. The description identifies your program to TIBCO Rendezvous for z/OS components. Browser administration interfaces display the description string. As a debugging aid, we recommend setting a unique description string for each transport. Use a string that distinguishes both the application and the role of the transport within it. Parameter
TRANSPORT DESCRIPTION
Description Set the description parameter of this transport. Use this string as the new program description. The function copies this string.
See Also
tibrvTransport,
tibrvTransport_GetDescription,
210
| Chapter 8
Transport
| 211
Chapter 9
Fault Tolerance
TIBCO Rendezvous for z/OS fault tolerance software coordinates a group of redundant processes into a fault-tolerant distributed system. Some processes actively fulfill the tasks of the application, while other processes wait in readiness. When one of the active processes fails, another process rapidly assumes active duty. See Also For a complete discussion of concepts and operating principles, see Fault Tolerance Concepts in TIBCO Rendezvous Concepts. For suggestions to help you design programs using fault tolerance features, see Fault Tolerance Concepts in TIBCO Rendezvous Concepts. For step-by-step hints for implementing fault-tolerant systems, see Developing Fault-Tolerant Programs in TIBCO Rendezvous Concepts. Fault tolerance software uses advisory messages to inform programs of status changes. For details, see Fault Tolerance (RVFT) Advisory Messages in TIBCO Rendezvous Concepts. If your application distributes fault-tolerant processes across network boundaries, you must configure the TIBCO Rendezvous for z/OS routing daemons to exchange _RVFT administrative messages. For details, see TIBCO Rendezvous Administration.
Topics
(Sheet 1 of 3) Function or Type
tibrvft_Version tibrvftAction
Description Identify the fault tolerance API release number. Instruct fault tolerance callback functions to react to changing circumstances.
212
| Chapter 9
Fault Tolerance
Description Member objects represent program membership in a fault tolerance group. Process fault tolerance events for a group member. A program can destroy a member object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Create a member of a fault tolerance group. Destroy a member of a fault tolerance group. Extract the group name of a fault tolerance member. Extract the event queue of a fault tolerance member. Extract the transport of a fault tolerance member. Extract the weight of a fault tolerance member. Change the weight of a fault tolerance member within its group.
tibrvftMemberCallback tibrvftMemberOnComplete
Monitors
tibrvftMonitor
Monitor objects express interest in fault tolerance events. Process fault tolerance events for a monitor. A program can destroy a monitor object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Monitor a fault tolerance group. Stop monitoring a fault tolerance group, and free associated resources.
tibrvftMonitorCallback tibrvftMonitorOnComplete
tibrvftMonitor_Create tibrvftMonitor_Destroy
236 238
Description Extract the group name of a fault tolerance monitor. Extract the event queue of a fault tolerance monitor. Extract the transport of a fault tolerance monitor.
214
| Chapter 9
Fault Tolerance
tibrvft_Version
Function Declaration Purpose
tibrvft_Version
tibrvftAction 215
tibrvftAction
Type Declaration
05 tibrvftAction PIC 9(9) 88 TIBRVFT-PREPARE-TO-ACTIVATE 88 TIBRVFT-ACTIVATE 88 TIBRVFT-DEACTIVATE BINARY. VALUE 1. VALUE 2. VALUE 3.
Purpose Remarks
Instruct fault tolerance callback functions to react to changing circumstances. Each token of this enumerated type designates a command to a fault tolerance callback function. The programs callback function receives one of these tokens in a parameter, and interprets it as an instruction from the TIBCO Rendezvous for z/OS fault tolerance software as described in this table (see also, Fault Tolerance Callback Actions in TIBCO Rendezvous Concepts. Description Prepare to activate (hint). TIBCO Rendezvous for z/OS fault tolerance software passes this token to the callback function to instruct the program to make itself ready to activate on short noticeso that if the callback function subsequently receives the instruction to activate, it can do so without delay. This token is a hint, indicating that the program might soon receive an instruction to activate. It does not guarantee that an activate instruction will follow, nor that any minimum time will elapse before an activate instruction follows.
Token
TIBRVFT-PREPARE-TO-ACTIVATE
TIBRVFT-ACTIVATE
Activate immediately. TIBCO Rendezvous for z/OS fault tolerance software passes this token to the callback function to instruct the program to activate.
TIBRVFT-DEACTIVATE
Deactivate immediately. TIBCO Rendezvous for z/OS fault tolerance software passes this token to the callback function to instruct the program to deactivate.
See Also
tibrvftMemberCallback, tibrvftMember_Create,
216
| Chapter 9
Fault Tolerance
tibrvftMember
Type Declaration Purpose See Also
tibrvftMember PIC 9(9) BINARY.
page 221
tibrvftMemberCallback 217
tibrvftMemberCallback
Function Type Declaration
ENTRY BY BY BY BY tibrvftMemberCallback USING VALUE MEMBER VALUE GROUPNAME VALUE ACTION VALUE CLOSURE.
Purpose Remarks
Process fault tolerance events for a group member. Each member program of a fault tolerance group must define a function of this type. Programs register a member callback function with each call to tibrvftMember_Create. TIBCO Rendezvous for z/OS fault tolerance software queues a member action event in three situations. In each case, it passes a different action argument, instructing the callback function to activate, deactivate, or prepare to activate the program. When the number of active members drops below the active goal, the fault tolerance callback function (in the ranking inactive member process) receives the token TIBRVFT-ACTIVATE; the callback function must respond by assuming the duties of an active member. When the number of active members exceeds the active goal, the fault tolerance callback function (in any active member that is outranked by another active member) receives the action token TIBRVFT-DEACTIVATE; the callback function must respond by switching the program to its inactive state. When the number of active members equals the active goal, and TIBCO Rendezvous for z/OS fault tolerance software detects that it might soon decrease below the active goal, the fault tolerance callback function (in the ranking inactive member) receives the action token TIBRVFT-PREPARE-TO-ACTIVATE; the callback function must respond by making the program ready to activate immediately. For example, preparatory steps might include time-consuming tasks such as connecting to a database. If the callback function subsequently receives the TIBRVFT-ACTIVATE token, it will be ready to activate without delay.
218
| Chapter 9
Fault Tolerance
For additional information see Fault Tolerance Callback Actions in TIBCO Rendezvous Concepts.
Parameter
MEMBER GROUPNAME
Description This parameter receives the member object. This parameter receives a string denoting the name of the fault tolerance group. This parameter receives a value of the enumerated type tibrvftAction, which instructs the callback function to activate, deactivate or prepare to activate. This parameter receives the closure data, which the program supplied in the call that created the member object. page 215 page 221
ACTION
CLOSURE
See Also
tibrvftAction,
tibrvftMember_Create,
tibrvftMemberOnComplete 219
tibrvftMemberOnComplete
Function Type Declaration
ENTRY tibrvftMemberOnComplete BY VALUE DESTROYEDMEMBER BY VALUE CLOSURE. USING
Purpose
A program can destroy a member object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Parameter
DESTROYEDMEMBER
Description This parameter receives the member event object. This object is identical to the object that the program created to join the fault tolerance group. However, by the time this function runs, the member is already destroyed; this function cannot use the member object in TIBCO Rendezvous for z/OS calls.
CLOSURE
This parameter receives the closure data, which the program supplied in the call that created the member object.
Remarks
This type of function is important in two situations: Internal fault tolerance callback functions run in several threads (because several threads dispatch the members event queue), and the program must do additional processing after these callback functions have completed in all threads. A member callback function calls tibrvftMember-DestroyEx() to withdraw from a fault tolerance group, and the program must do additional processing after the rest of the callback function has completed.
Upon return from tibrvftMember-DestroyEx(), the destroyed members callback function can no longer begin to run (this is also true of internal callback functions). However, in each thread where a callback function is already in progress, that callback function does continue to run until complete.
tibrvftMember_DestroyEx() tibrvftMemberOnComplete.
accepts a completion function argument of type TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed.
220
| Chapter 9
Fault Tolerance
This information in completely analogous to tibrvEventOnComplete on page 124. See that section for important details.
tibrvftMember_Create,
tibrvftMember_DestroyEx(),
tibrvftMember_Create 221
tibrvftMember_Create
Function Declaration
CALL tibrvftMember_Create USING BY REFERENCE MEMBER BY VALUE QUEUE BY VALUE CALLBACK BY VALUE TRANSPORT BY REFERENCE GROUPNAME BY VALUE WEIGHT BY VALUE ACTIVEGOAL BY VALUE HEARTBEATINTERVAL BY VALUE PREPARATIONINTERVAL BY VALUE ACTIVATIONINTERVAL BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL RVBFCRE
Create a member of a fault tolerance group. Upon creating a member object, the program becomes a member of the group. A program may hold simultaneous memberships in several distinct fault tolerance groups. For examples, see Multiple Groups in TIBCO Rendezvous Concepts. Avoid joining the same group twice. It is illegal for a program to maintain more than one membership in any one fault tolerance group. The function tibrvftMember_Create does not guard against this illegal situation, and results are unpredictable. All arguments are required except for preparationInterval (which may be zero) and closure (which may be NULL).
(Sheet 1 of 3) Parameter
MEMBER
Description This member object denotes membership in a fault tolerance group. The program supplies a location, and the function stores the new member object in that location. The member object remains valid until the program explicitly destroys it.
QUEUE CALLBACK
Place fault tolerance events for this member on this event queue. On dispatch, process the event with this callback function.
222
| Chapter 9
Fault Tolerance
(Sheet 2 of 3) Parameter
TRANSPORT
Description Use this transport for fault tolerance internal protocol messages (such as heartbeat messages). Join the fault tolerant group with this name. The group name must conform to the syntax required for TIBCO Rendezvous for z/OS subject names. For details, see Subject Names in TIBCO Rendezvous Concepts.
GROUPNAME
WEIGHT
Weight represents the ability of this member to fulfill its purpose, relative to other members of the same fault tolerance group. TIBCO Rendezvous for z/OS fault tolerance software uses relative weight values to select which members to activate; members with higher weight take precedence over members with lower weight. Acceptable values range from 1 to 65535. Zero is a special, reserved value; TIBCO Rendezvous for z/OS fault tolerance software assigns zero weight to processes with resource errors, so they only activate when no other members are available. For more information, see Rank and Weight in TIBCO Rendezvous Concepts.
ACTIVEGOAL
TIBCO Rendezvous for z/OS fault tolerance software sends callback instructions to maintain this number of active members. Acceptable values range from 1 to 65535.
HEARTBEATINTERVAL
When this member is active, it sends heartbeat messages at this interval (in seconds). The interval must be positive. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts.
tibrvftMember_Create 223
(Sheet 3 of 3) Parameter
PREPARATIONINTERVAL
Description When the heartbeat signal from one or more active members has been silent for this interval (in seconds), TIBCO Rendezvous for z/OS fault tolerance software issues an early warning hint (TIBRVFT-PREPARE-TO-ACTIVATE) to the ranking inactive member. This warning lets the inactive member prepare to activate, for example, by connecting to a database server, or allocating memory. The interval must be non-negative. Zero is a special value, indicating that the member does not need advance warning to activate; TIBCO Rendezvous for z/OS fault tolerance software never issues a TIBRVFT-PREPARE-TO-ACTIVATE hint when this value is zero. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts.
ACTIVATIONINTERVAL
When the heartbeat signal from one or more active members has been silent for this interval (in seconds), TIBCO Rendezvous for z/OS fault tolerance software considers the silent member to be lost, and issues the instruction to activate (TIBRVFT-ACTIVATE) to the ranking inactive member. When a new member joins a group, TIBCO Rendezvous for z/OS fault tolerance software identifies the new member to existing members (if any), and then waits for this interval to receive identification from them in return. If, at the end of this interval, it determines that too few members are active, it issues the activate instruction (TIBRVFT-ACTIVATE) to the new member. Then interval must be positive. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts.
CLOSURE
Store this closure data on the member object. The heartbeat interval must be less than the activation interval. If the preparation interval is non-zero, it must be greater than the heartbeat interval and less than the activation interval. It is an error to violate these rules. In addition, intervals must be reasonable for the hardware and network conditions. For information and examples, see Choose the Intervals in TIBCO Rendezvous Concepts.
Intervals
Group Name
The group name must be a legal TIBCO Rendezvous for z/OS subject name (see Subject Names in TIBCO Rendezvous Concepts). You may use names with several elements; for examples, see Multiple Groups in TIBCO Rendezvous Concepts.
224
| Chapter 9
Fault Tolerance
See Also
tibrvftAction,
page 215
tibrvftMemberCallback, tibrvftMember_Destroy,
page 217 page 225 Choose Group Name in TIBCO Rendezvous Concepts Choose the Active Goal in TIBCO Rendezvous Concepts Choose the Intervals in TIBCO Rendezvous Concepts Program Start Sequence in TIBCO Rendezvous Concepts
tibrvftMember_Destroy 225
tibrvftMember_Destroy
Function Declaration
CALL tibrvftMember_Destroy USING BY VALUE MEMBER RETURNING TIBRV-STATUS END-CALL RVBFDES CALL tibrvftMember_DestroyEx USING BY VALUE MEMBER BY VALUE COMPLETIONFUNCTION RETURNING TIBRV-STATUS END-CALL RVBFDESX
Short Name
Destroy a member of a fault tolerance group. By destroying a member object, the program cancels or withdraws its membership in the group. This function has two effects: If this member is active, stop sending the heartbeat signal. Reclaim the program storage associated with this member.
Once a program withdraws from a group, it no longer receives fault tolerance events. One direct consequence is that an active program that withdraws can never receive an instruction to deactivate. Parameter
MEMBER
Description Destroy this member object, and cancel membership in its fault tolerance group.
226
| Chapter 9
Fault Tolerance
Parameter
COMPLETIONFUNCTION
Description TIBCO Rendezvous for z/OS software runs this function immediately after all instances of the members callback function (and internal callback functions) have completed. If callback functions are not running when the event is destroyed, the destroy call runs it before returning. If this parameter is NULL,
tibrvftMember_DestroyEx
does not run a completion function; instead, its behavior is the same as tibrvftMember_Destroy.
Although tibrvftMember_DestroyEx prevents future dispatch calls from running the destroyed members callback function, that callback function might be already running in one or more threads that dispatch events from the same queue. In each thread where the callback function is already in progress, that callback function does continue to run until complete. TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed; for important details, see tibrvEventOnComplete on page 124.
tibrvftMember_Create,
See Also
tibrvftMemberOnComplete,
tibrvftMember_GetGroupName 227
tibrvftMember_GetGroupName
Function Declaration
CALL tibrvftMember_GetGroupName USING BY VALUE MEMBER BY REFERENCE GROUPNAME RETURNING TIBRV-STATUS END-CALL RVBFGGN
Description Extract the group name from this member object. The program supplies a location, and the function stores the group name in that location.
228
| Chapter 9
Fault Tolerance
tibrvftMember_GetQueue
Function Declaration
CALL tibrvftMember_GetQueue USING BY VALUE MEMBER BY REFERENCE QUEUE RETURNING TIBRV-STATUS END-CALL RVBFGQ
Description Extract the event queue from this member object. The program supplies a location, and the function stores the queue in that location.
tibrvftMember_GetTransport 229
tibrvftMember_GetTransport
Function Declaration
CALL tibrvftMember_GetTransport USING BY VALUE MEMBER BY REFERENCE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBFGT
Description Extract the transport from this member object. The program supplies a location, and the function stores the transport in that location.
230
| Chapter 9
Fault Tolerance
tibrvftMember_GetWeight
Function Declaration
CALL tibrvftMember_GetWeight USING BY VALUE MEMBER BY REFERENCE WEIGHT RETURNING TIBRV-STATUS END-CALL RVBFGW
Description Extract the weight from this member object. The program supplies a location, and the function stores the weight in that location.
tibrvftMember_SetWeight 231
tibrvftMember_SetWeight
Function Declaration
CALL tibrvftMember_SetWeight USING BY VALUE MEMBER BY VALUE WEIGHT RETURNING TIBRV-STATUS END-CALL RVBFSW
Change the weight of a fault tolerance member within its group. Weight summarizes the relative suitability of a member for its task, relative to other members of the same fault tolerance group. That suitability is a combination of computer speed and load factors, network bandwidth, computer and network reliability, and other factors. Programs may reset their weight when any of these factors change, overriding the previous assigned weight. You can use relative weights to indicate priority among group members. Zero is a special value; TIBCO Rendezvous for z/OS fault tolerance software assigns zero weight to processes with resource errors, so they only activate when no other members are available. Programs must always assign weights greater than zero. When TIBCO Rendezvous for z/OS fault tolerance software requests a resource but receives an error (for example, the member process cannot allocate memory, or start a timer), it attempts to send the member process a DISABLING_MEMBER advisory message, and sets the members weight to zero, effectively disabling the member. Weight zero implies that this member is active only as a last resort when no other members outrank it. (However, if the disabled member process does become active, it might not operate correctly.) Parameter
MEMBER WEIGHT
Description Set the weight of this member object. The new weight value. See WEIGHT on page 222.
See Also
232
| Chapter 9
Fault Tolerance
tibrvftMonitor
Type Declaration Purpose See Also
tibrvftMonitor PIC 9(9) BINARY.
page 236
tibrvftMonitorCallback 233
tibrvftMonitorCallback
Function Type Declaration
ENTRY BY BY BY BY tibrvftMonitorCallback VALUE MONITOR VALUE GROUPNAME VALUE NUMACTIVEMEMBERS VALUE CLOSURE. USING
Purpose Remarks
Process fault tolerance events for a monitor. A program must define a function of this type as a prerequisite for monitoring a fault tolerance group. Programs register a monitor callback function with each call to tibrvftMonitor_Create on page 236. TIBCO Rendezvous for z/OS fault tolerance software queues a monitor event whenever the number of active members in the group changes. A program need not be a member of a group in order to monitor that group. Programs that do not monitor need not define a monitor callback function. Parameter
MONITOR GROUPNAME
Description This parameter receives the monitor object. This parameter receives a string denoting the name of the fault tolerance group. This parameter receives the number of group members now active. This parameter receives the closure data, which the program supplied in the call that created the monitor object. page 236
NUMACTIVEMEMBERS
CLOSURE
See Also
tibrvftMonitor_Create,
234
| Chapter 9
Fault Tolerance
tibrvftMonitorOnComplete
Function Type Declaration
ENTRY tibrvftMonitorOnComplete BY VALUE DESTROYEDMONITOR BY VALUE CLOSURE. USING
Purpose
A program can destroy a monitor object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions in progress have completed. Parameter
DESTROYEDMONITOR
Description This parameter receives the monitor event object. This object is identical to the object that the program created to monitor the fault tolerance group. However, by the time this function runs, the monitor is already destroyed; this function cannot use the monitor object in TIBCO Rendezvous for z/OS calls.
CLOSURE
This parameter receives the closure data, which the program supplied in the call that created the monitor object.
Remarks
This type of function is important in two situations: Internal fault tolerance callback functions run in several threads (because several threads dispatch the monitors event queue), and the program must do additional processing after these callback functions have completed in all threads. A monitor callback function calls tibrvftMonitor-DestroyEx to withdraw from a fault tolerance group, and the program must do additional processing after the rest of the callback function has completed.
Upon return from tibrvftMonitor-DestroyEx, the destroyed monitors callback function can no longer begin to run (this is also true of internal callback functions). However, in each thread where a callback function is already in progress, that callback function does continue to run until complete.
tibrvftMonitor-DestroyEx()
the completion function runs when the last callback-in-progress has completed.
tibrvftMonitorOnComplete 235
This information in completely analogous to tibrvEventOnComplete on page 124. See that section for important details.
tibrvftMonitor_Create,
tibrvftMonitor_Destroy,
236
| Chapter 9
Fault Tolerance
tibrvftMonitor_Create
Function Declaration
CALL tibrvftMonitor_Create USING BY REFERENCE MONITOR BY VALUE QUEUE BY VALUE CALLBACK BY VALUE TRANSPORT BY REFERENCE GROUPNAME BY VALUE LOSTINTERVAL BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL RVBNCRE
Monitor a fault tolerance group. Monitors are passivethey do not affect the group members in any way. TIBCO Rendezvous for z/OS fault tolerance software queues a monitor event whenever the number of active members in the group changeseither it detects a new heartbeat, or it detects that the heartbeat from a previously active member is now silent, or it receives a message from the fault tolerance component of an active member indicating deactivation or termination. The monitor callback function receives the number of active members as an argument. The group need not have any members at the time of this function call. (Sheet 1 of 2) Parameter
MONITOR
Description This monitor object denotes a passive monitor of a fault tolerance group. The program supplies a location, and the function stores the new monitor object in that location. The monitor object remains valid until the program explicitly destroys it.
Place events for this monitor on this event queue. On dispatch, process the event with this callback function. Listen on this transport for fault tolerance internal protocol messages (such as heartbeat messages).
tibrvftMonitor_Create 237
(Sheet 2 of 2) Parameter
GROUPNAME
Description Monitor the fault tolerant group with this name. The group name must conform to the syntax required for TIBCO Rendezvous for z/OS subject names. For details, see Subject Names in TIBCO Rendezvous Concepts. See also, Group Name on page 237.
LOSTINTERVAL
When the heartbeat signal from an active member has been silent for this interval (in seconds), TIBCO Rendezvous for z/OS fault tolerance software considers that member lost, and queues a monitor event. The interval must be positive. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts. See also, Lost Interval on page 237.
CLOSURE
Lost Interval
The monitor uses the LOSTINTERVAL to determine whether a member is still active. When the heartbeat signal from an active member has been silent for this interval (in seconds), the monitor considers that member lost, and queues a monitor event. We recommend setting the LOSTINTERVAL identical to the groups activationInterval, so the monitor accurately reflects the behavior of the group members.
Group Name
The group name must be a legal TIBCO Rendezvous for z/OS subject name (see Subject Names in TIBCO Rendezvous Concepts). You may use names with several elements; for examples, see Multiple Groups in TIBCO Rendezvous Concepts.
tibrvftMonitorCallback, tibrvftMonitor_Destroy,
See Also
238
| Chapter 9
Fault Tolerance
tibrvftMonitor_Destroy
Function Declaration
CALL tibrvftMonitor_Destroy USING BY VALUE MONITOR RETURNING TIBRV-STATUS END-CALL RVBNDES CALL tibrvftMonitor_DestroyEx USING BY VALUE MONITOR BY VALUE COMPLETIONFUNCTION RETURNING TIBRV-STATUS END-CALL RVBNDESX
Short Name
Stop monitoring a fault tolerance group, and free associated resources. Parameter
MONITOR COMPLETIONFUNCTION
Description Destroy this monitor object. TIBCO Rendezvous for z/OS software runs this function immediately after all instances of the monitors callback function (and internal callback functions) have completed. If callback functions are not running when the monitor is destroyed, the destroy call runs it before returning. If this parameter is NULL,
tibrvftMonitor_DestroyEx() does not run a completion function; instead, its behavior is the same as tibrvftMonitor_Destroy.
Although tibrvftMonitor_DestroyEx() prevents future dispatch calls from running the destroyed monitors callback function, a callback function might be already running in one or more threads that dispatch events from the same queue. In each thread where the callback function is already in progress, that callback function does continue to run until complete. TIBCO Rendezvous for z/OS software ensures that the completion function runs when the last callback-in-progress has completed; for important details, see tibrvftMonitorOnComplete on page 234.
tibrvftMonitor_GetGroupName 239
tibrvftMonitor_GetGroupName
Function Declaration
CALL tibrvftMonitor_GetGroupName USING BY VALUE MONITOR BY REFERENCE GROUPNAME RETURNING TIBRV-STATUS END-CALL RVBNGGN
Description Extract the group name from this monitor object. The program supplies a location, and the function stores the group name in that location.
240
| Chapter 9
Fault Tolerance
tibrvftMonitor_GetQueue
Function Declaration
CALL tibrvftMonitor_GetQueue USING BY VALUE MONITOR BY REFERENCE QUEUE RETURNING TIBRV-STATUS END-CALL RVBNGQ
Description Extract the event queue from this monitor object. The program supplies a location, and the function stores the queue in that location.
tibrvftMonitor_GetTransport 241
tibrvftMonitor_GetTransport
Function Declaration
CALL tibrvftMonitor_GetTransport USING BY VALUE MONITOR BY REFERENCE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBNGT
Description Extract the transport from this monitor object. The program supplies a location, and the function stores the transport in that location.
242
| Chapter 9
Fault Tolerance
| 243
Chapter 10
Although TIBCO Rendezvous for z/OS communications are highly reliable, some applications require even stronger assurances of delivery. Certified delivery features offers greater certainty of deliveryeven in situations where processes and their network connections are unstable.
See Also
This API implements TIBCO Rendezvous for z/OS certified delivery features. For a complete discussion, see Certified Message Delivery in TIBCO Concepts. Certified delivery software uses advisory messages extensively. For example, advisories inform sending and receiving programs of the delivery status of each message. For complete details, see Certified Message Delivery (RVCM) Advisory Messages in TIBCO Rendezvous Concepts. If your application sends or receives certified messages across network boundaries, you must configure the TIBCO Rendezvous for z/OS routing daemons to exchange _RVCM administrative messages. For details, see Certified Message Delivery in TIBCO Rendezvous Administration. Some programs require certified delivery to one of n listeners. See Distributed Queue in TIBCO Rendezvous Concepts.
Topics
Operations by Functional Group, page 244 Operations in Alphabetical Order, page 248
244
| Chapter 10
Description
Page
Listen for messages that match the subject, and request certified delivery when available. Programs define functions of this type to process inbound certified or labeled messages. Destroy a certified delivery listener.
257
tibrvcmEventCallback
254
tibrvcmEvent_Destroy
260
Sending Messages
tibrvcmTransport_Send tibrvcmTransport_SendReply tibrvcmTransport_SendRequest
Send a labeled message. Send a labeled reply message. Send a labeled request message and wait for a reply.
Override automatic confirmation of delivery for this listener. Explicitly confirm delivery of a certified message.
265 256
tibrvcmEvent_ConfirmMsg
Registration
tibrvcmTransport_AddListener tibrvcmTransport_AllowListener
Pre-register an anticipated listener. Invite the named receiver to reinstate certified delivery for its listeners, superseding the effect of any previous disallow calls.
267 269
(Sheet 2 of 4) Function
tibrvcmTransport_DisallowListener
Description Cancel certified delivery to all listeners at a specific correspondent. Deny subsequent certified delivery registration requests from those listeners. Unregister a specific listener at a specific correspondent, and free associated storage in the senders ledger.
Page 277
tibrvcmTransport_RemoveListener
287
Relay Agents
tibrvcmTransport_ConnectToRelayAgent
Connect a certified delivery transport to its designated relay agent. Disconnect a certified delivery transport from its relay agent.
270
tibrvcmTransport_DisconnectFromRelayAgent
279
Ledger
tibrvcmTransport_RemoveSendState
Reclaim ledger space from obsolete subjects. Query the ledger for stored items related to a subject name. Programs define functions of this type to process ledger review summary messages. Synchronize the ledger to it its storage medium.
tibrvcmTransport_ReviewLedger
tibrvcmReviewCallback
tibrvcmTransport_SyncLedger
298
Listener Attributes
tibrvcmEvent_GetListenerSubject
Extract the subject from a certified delivery listener event object. Extract the certified delivery transport from a certified delivery listener event object.
262 263
tibrvcmEvent_GetListenerTransport
246
| Chapter 10
(Sheet 3 of 4) Function
tibrvcmEvent_GetQueue
Description Extract the queue of a certified delivery listener object. Override automatic confirmation of delivery for this listener.
tibrvcmEvent_SetExplicitConfirm
272 276
tibrvcmTransport_Destroy
Transport Attributes
tibrvcmTransport_GetLedgerName
Extract the ledger name of a certified delivery transport. Extract the correspondent name of a certified delivery transport. Extract the correspondent name of a certified delivery transport. Extract the name of the relay agent used by a certified delivery transport. Extract the request old messages flag of a certified delivery transport. Extract the sync ledger flag of a certified delivery transport. Extract the transport employed by a certified delivery transport. Set the default message time limit for all outbound certified messages from a transport.
tibrvcmTransport_GetName
tibrvcmTransport_GetName
tibrvcmTransport_GetRelayAgent
tibrvcmTransport_GetRequestOld
284
tibrvcmTransport_GetSyncLedger
tibrvcmTransport_GetTransport
tibrvcmTransport_SetDefaultCMTimeLimit
(Sheet 4 of 4) Function
Message Attributes
tibrvMsg_GetCMSender
Description
Page
Extract the correspondent name of the sender from a certified message. Extract the sequence number from a certified message. Extract the message time limit from a certified message. Set the message time limit of a certified message.
299
tibrvMsg_GetCMSequence
tibrvMsg_GetCMTimeLimit
tibrvMsg_SetCMTimeLimit
A certified delivery event object listens for labeled messages and certified messages. A certified delivery transport object implements the CM delivery protocol for messages. Programs define functions of this type to process inbound certified or labeled messages. Programs define functions of this type to process ledger review summary messages.
253
tibrvcmTransport
266
tibrvcmEventCallback
254
tibrvcmReviewCallback
291
Library Version
tibrvcm_Version()
252
259
248
| Chapter 10
Page 252
A certified delivery event object listens for labeled messages and certified messages. Programs define functions of this type to process inbound certified or labeled messages. Explicitly confirm delivery of a certified message. Listen for messages that match the subject, and request certified delivery when available. Implements a call-back for the certified listener. Destroy a certified delivery listener. Extract the subject from a certified delivery listener event object. Extract the certified delivery transport from a certified delivery listener event object. Extract the queue of a certified delivery listener object. Override automatic confirmation of delivery for this listener.
253
tibrvcmEventCallback
254
tibrvcmEvent_ConfirmMsg
256 257
tibrvcmEvent_CreateListener
tibrvcmEvent_CreateListener_Cobol
tibrvcmEvent_Destroy
tibrvcmEvent_GetListenerSubject
tibrvcmEvent_GetListenerTransport
tibrvcmEvent_GetQueue
264 265
tibrvcmEvent_SetExplicitConfirm
(Sheet 2 of 4) Function
Certified Delivery Transports
tibrvcmTransport
Description
Page
A certified delivery transport object implements the CM delivery protocol for messages. Pre-register an anticipated listener. Invite the named receiver to reinstate certified delivery for its listeners, superseding the effect of any previous disallow calls. Connect a certified delivery transport to its designated relay agent. Create a transport for certified delivery. Destroy a certified delivery transport. Cancel certified delivery to all listeners at a specific correspondent. Deny subsequent certified delivery registration requests from those listeners. Disconnect a certified delivery transport from its relay agent. Extract the ledger name of a certified delivery transport. Extract the correspondent name of a certified delivery transport. Extract the correspondent name of a certified delivery transport.
266
tibrvcmTransport_AddListener tibrvcmTransport_AllowListener
267 269
tibrvcmTransport_ConnectToRelayAgent
270
tibrvcmTransport_Create
tibrvcmTransport_Destroy
tibrvcmTransport_DisallowListener
tibrvcmTransport_DisconnectFromRelayAgent
tibrvcmTransport_GetLedgerName
tibrvcmTransport_GetName
tibrvcmTransport_GetName
250
| Chapter 10
(Sheet 3 of 4) Function
tibrvcmTransport_GetRelayAgent
Description Extract the name of the relay agent used by a certified delivery transport. Extract the request old messages flag of a certified delivery transport. Extract the sync ledger flag of a certified delivery transport. Extract the transport employed by a certified delivery transport. Reclaim ledger space from obsolete subjects. Query the ledger for stored items related to a subject name. Programs define functions of this type to process ledger review summary messages. Send a labeled message. Send a labeled reply message. Send a labeled request message and wait for a reply. Set the default message time limit for all outbound certified messages from a transport. Synchronize the ledger to it its storage medium.
Page 283
tibrvcmTransport_GetRequestOld
284
tibrvcmTransport_GetSyncLedger
tibrvcmTransport_GetTransport
tibrvcmTransport_RemoveSendState
tibrvcmTransport_ReviewLedger
tibrvcmReviewCallback
tibrvcmTransport_SetDefaultCMTimeLimit
tibrvcmTransport_SyncLedger
298
Certified Messages
tibrvMsg_GetCMSender
299
(Sheet 4 of 4) Function
tibrvMsg_GetCMSequence
Description Extract the sequence number from a certified message. Extract the message time limit from a certified message. Set the message time limit of a certified message.
tibrvMsg_GetCMTimeLimit
tibrvMsg_SetCMTimeLimit
252
| Chapter 10
tibrvcm_Version()
Function Declaration Purpose
tibrvcm_Version
tibrvcmEvent 253
tibrvcmEvent
Type Declaration Purpose
tibrvcmEvent PIC 9(9) BINARY.
A certified delivery event object listens for labeled messages and certified messages. Each call to the event creation function tibrvcmEvent_CreateListener results in a new certified delivery event object, which represents your programs listening interest in a stream of labeled messages and certified messages. TIBCO Rendezvous for z/OS software uses the same event object to signal each occurrence of such an event. Programs use the event object as a token; they cannot view or modify the object, except using accessor functions.
tibrvcmEvent_Destroy.
Remarks
Programs must explicitly destroy each certified delivery event object using Destroying a certified listener object cancels the programs immediate interest in that event, and frees its storage; nonetheless, a parameter to the destroy call determines whether certified delivery agreements continue to persist beyond the destroy call.
See Also
tibrvcmEvent_CreateListener, tibrvcmEvent_Destroy,
page 257 page 260 tibrvcmEvent_GetListenerSubject, page 262 tibrvcmEvent_GetListenerTransport, page 263 tibrvcmEvent_GetQueue, page 264 tibrvcmEvent_SetExplicitConfirm, page 265 tibrvcmEvent_ConfirmMsg, page 256
254
| Chapter 10
tibrvcmEventCallback
Function Type Declaration
ENTRY tibrvcmEventCallback BY VALUE CMLISTENER, BY VALUE MESSAGE, BY VALUE CLOSURE. USING
Purpose
Programs define functions of this type to process inbound certified or labeled messages. This callback function must also be able to process uncertified and unlabeled messages. Parameter
CMLISTENER
Remarks
Description This parameter receives the listener object. This object is identical to the certified listener object that the program created to begin listening. The callback receives the inbound message in this parameter. If the inbound message is empty, this parameter receives a message that has no fields. This parameter receives the closure data, which the program supplied in the call that created the event object.
MESSAGE
CLOSURE
CM Label Information
CM callback functions can use CM label information to discriminate these situations: If tibrvMsg_GetCMSender returns status code TIBRV-NOT-FOUND, then the message uses the reliable protocol (that is, it was sent from an ordinary transport). If tibrvMsg_GetCMSender returns TIBRV-OK, then the message uses the certified delivery protocol (that is, it is a labeled message, sent from a CM transport). Once the CM callback function determines that the message uses the certified delivery protocol, it can discriminate further: If tibrvMsg_GetCMSequence returns status code TIBRV-NOT-FOUND, then the listener is not registered for certified delivery from the sender. If tibrvMsg_GetCMSequence returns TIBRV-OK, then a certified delivery agreement is in effect for this subject with the sender.
tibrvcmEventCallback 255
See Also
tibrvcmEvent_CreateListener, tibrvMsg_GetCMSender,
page 257 page 299 tibrvMsg_GetCMSequence, page 300 tibrvMsg_GetCMTimeLimit, page 302
256
| Chapter 10
tibrvcmEvent_ConfirmMsg
Function Declaration
CALL tibrvcmEvent_ConfirmMsg USING BY VALUE CMLISTENER BY VALUE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBCCMSG
Explicitly confirm delivery of a certified message. Use this function only in programs that override automatic confirmation (see tibrvcmEvent_SetExplicitConfirm on page 265). The default behavior of certified listeners is to automatically confirm delivery when the callback function returns. Parameter
CMLISTENER MESSAGE
Unregistered Message
When a CM listener receives a labeled message, its behavior depends on context: If a CM listener is registered for certified delivery, it presents the supplementary information to the callback function. If the sequence number is present, then the receiving program can confirm delivery. If a CM listener is not registered for certified delivery with the sender, it presents the senders name to the callback function, but omits the sequence number. In this case, the receiving program cannot confirm delivery; tibrvcmEvent_ConfirmMsg returns the status code TIBRV-NOT-PERMITTED. Notice that the first labeled message that a program receives on a subject might not be certified; that is, the sender has not registered a certified delivery agreement with the listener. If appropriate, the certified delivery library automatically requests that the sender register the listener for certified delivery. (See Discovery and Registration for Certified Delivery in TIBCO Rendezvous Concepts. A labeled but uncertified message can also result when the sender explicitly disallows or removes the listener.
See Also
tibrvcmEvent,
tibrvcmEvent_SetExplicitConfirm,
tibrvcmEvent_CreateListener 257
tibrvcmEvent_CreateListener
Function Declaration
CALL tibrvcmEvent_CreateListener USING BY REFERENCE CMLISTENER BY VALUE QUEUE BY VALUE CALLBACK BY VALUE CMTRANSPORT BY REFERENCE SUBJECT BY VALUE 0 RETURNING TIBRV-STATUS END-CALL RVBCCRL
Listen for messages that match the subject, and request certified delivery when available. Parameter
CMLISTENER
Description For each inbound message, place this listener event on the event queue. The program supplies a location, and the function stores the new listener object in that location. The event object remains valid until the program explicitly destroys it.
QUEUE
For each inbound message, place the listener event on this event queue. On dispatch, process the event with this callback function. Listen for inbound messages on this certified delivery transport. Listen for inbound messages with subjects that match this specification. Wildcard subjects are permitted. The empty string is not a legal subject name.
CALLBACK CMTRANSPORT
SUBJECT
Details of listener event semantics are identical to those for ordinary listeners; see Activation and Dispatch on page 129.
258
| Chapter 10
Inbox Listener
To receive unicast (point-to-point) messages, listen to a unique inbox subject name. First call tibrvTransport_CreateInbox to create the unique inbox name; then call tibrvcmEvent_CreateListener to begin listening. Remember that other programs have no information about an inbox until the listening program uses it as a reply subject in an outbound message.
tibrvcmEvent,
See Also
page 253
tibrvcmTransport_Destroy,
tibrvcmEvent_CreateListener_Cobol 259
tibrvcmEvent_CreateListener_Cobol
Convenience Function Declaration
CALL tibrvcmEvent_CreateListener_Cobol USING BY REFERENCE CMLISTENID BY VALUE QUEUE BY VALUE CMTRANSPORT BY REFERENCE SUBJECT BY REFERENCE CLOSURE BY VALUE 0 RETURNING TIBRV-STATUS END-CALL RVBCCEV
Implements a call-back for the certified listener. This call-back must be explicitly destroyed (using tibrvEvent_Destroy).
Parameter
CMLISTENID QUEUE CMTRANSPORT SUBJECT CLOSURE
Description Specify listener for callback routine. Specify the default queue. Specify the Rendezvous transport. Specify the subject name that is to be listened for. Specify the message pointer.
260
| Chapter 10
tibrvcmEvent_Destroy
Function Declaration
CALL tibrvcmEvent_Destroy USING BY VALUE CMLISTENER BY VALUE CANCELAGREEMENTS RETURNING TIBRV-STATUS END-CALL RVBCDES CALL tibrvcmEvent_DestroyEx USING BY VALUE CMLISTENER BY VALUE CANCELAGREEMENTS BY VALUE COMPLETIONFUNCTION RETURNING TIBRV-STATUS END-CALL
Short Name
RVBCDESX
leaves all certified delivery agreements in effect, so certified senders continue to store messages.
COMPLETIONFUNCTION
TIBCO Rendezvous for z/OS software runs this function immediately after all instances of the events callback function have completed. If the events callback function is not running when the event is destroyed, the destroy call runs it before returning. If this parameter is NULL, tibrvcmEvent_DestroyEx does not run a completion function; instead, its behavior is the same as tibrvcmEvent_Destroy. See tibrvEventOnComplete on page 124.
Remarks
Destroying event interest invalidates the event object; passing the event object as an argument to subsequent API calls produces an error.
tibrvcmEvent_Destroy 261
Canceling Agreements
When destroying a listener, a program can either cancel its certified delivery agreements with senders, or let those agreements persist (so a successor listener can receive the messages covered by those agreements). When canceling agreements, each (previously) certified sender transport receives a REGISTRATION.CLOSED advisory. In addition, sender transports receive a DELIVERY.FAILED advisory for each undelivered message to the destroyed listener, and delete those undelivered messages from their ledgers; successor listeners cannot receive old messages.
Extended Function
Although tibrvcmEvent_Destroy and tibrvcmEvent_DestroyEx prevent future dispatch calls from running the destroyed events callback function, that callback function might be already running in one or more threads that dispatch events from the same queue. In each thread where the callback function is already in progress, that callback function does continue to run until complete.
tibrvcmEvent_DestroyEx ensures that its COMPLETIONFUNCTION runs when the last callback-in-progress has completed; for important details, see tibrvEventOnComplete on page 124.
See Also
tibrvcmEvent,
page 253
262
| Chapter 10
tibrvcmEvent_GetListenerSubject
Function Declaration
CALL tibrvcmEvent_GetListenerSubject USING BY VALUE CMLISTENER BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBCGLS
Extract the subject from a certified delivery listener event object. Parameter
CMLISTENER SUBJECT
Description Extract the subject from this listener. The program supplies a location. The function stores the subject of the listener event object in that location. page 253
See Also
tibrvcmEvent,
tibrvcmEvent_GetListenerTransport 263
tibrvcmEvent_GetListenerTransport
Function Declaration
CALL tibrvcmEvent_GetListenerTransport USING BY VALUE CMLISTENER BY REFERENCE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBCGLT
Extract the certified delivery transport from a certified delivery listener event object. Parameter
CMLISTENER TRANSPORT
Description Extract the transport from this listener. The program supplies a location. The function stores the certified delivery transport of the listener event object in that location. page 253 page 266
See Also
tibrvcmEvent,
tibrvcmTransport,
264
| Chapter 10
tibrvcmEvent_GetQueue
Function Declaration
CALL tibrvcmEvent_GetQueue USING BY VALUE CMLISTENER BY REFERENCE QUEUE RETURNING TIBRV-STATUS END-CALL RVBCGQ
Description Extract the event queue from this event object. The program supplies a location. The function stores the event objects queue in that location. page 253 page 154
See Also
tibrvcmEvent, tibrvQueue,
tibrvcmEvent_SetExplicitConfirm 265
tibrvcmEvent_SetExplicitConfirm
Function Declaration
CALL tibrvcmEvent_SetExplicitConfirm USING BY VALUE CMLISTENER RETURNING TIBRV-STATUS END-CALL RVBCSEC
Override automatic confirmation of delivery for this listener. The default behavior of certified listeners is to automatically confirm delivery when the callback function returns (see tibrvcmEventCallback on page 254). This call selectively overrides this behavior for this specific listener (without affecting other listeners). By overriding automatic confirmation, the listener assumes responsibility to explicitly confirm each inbound certified message by calling tibrvcmEvent_ConfirmMsg. Consider overriding automatic confirmation when the processing of inbound messages involves activity that is asynchronous with respect to the message callback method; for example, computations in other threads or additional network communications. No method exists to restore the default behavior, reversing the effect of this function. Parameter
CMLISTENER
Description Override automatic confirmation for this listener. page 253 page 254 page 256
See Also
tibrvcmEvent,
tibrvcmEventCallback,
tibrvcmEvent_ConfirmMsg,
266
| Chapter 10
tibrvcmTransport
Type Declaration Purpose
tibrvcmTransport PIC 9(9) BINARY.
A certified delivery transport object implements the CM delivery protocol for messages. Each certified delivery transport employs a tibrvTransport for network communications. The tibrvcmTransport adds the accounting mechanisms needed for delivery tracking and certified delivery. Several tibrvcmTransport objects can employ the tibrvTransport, which also remains available for its own ordinary listeners and for sending ordinary messages. Programs must explicitly destroy each certified delivery transport object. Destroying a certified delivery transport object invalidates subsequent certified send calls on that object, invalidates any certified listeners using that transport (while preserving the certified delivery agreements of those listeners), and frees the transports storage.
Remarks
See Also
tibrvcmTransport_Create,
tibrvcmTransport_AddListener 267
tibrvcmTransport_AddListener
Function Declaration
CALL tibrvcmTransport_Addistener USING BY VALUE CMTRANSPORT BY REFERENCE CMNAME BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBPADL
Pre-register an anticipated listener. Some sending programs can anticipate requests for certified deliveryeven before the listening programs actually register. In such situations, the sender can pre-register listeners, so TIBCO Rendezvous for z/OS software begins storing outbound messages in the senders ledger; when the listener requests certified delivery, it receives the backlogged messages. If the correspondent with this CMNAME already receives certified delivery of this subject from this sender transport, then tibrvcmTransport_AddListener has no effect. If the correspondent with this CMNAME is disallowed, returns the status code TIBRV-NOT-PERMITTED. You can call tibrvcmTransport_AllowListener to supersede the effect of a prior call to tibrvcmTransport_DisallowListener; then call tibrvcmTransport_AddListener again.
tibrvcmTransport_AddListener
It is not sufficient for a sender to use this function to anticipate listeners; the anticipated listening programs must also require old messages when creating certified delivery transports. Parameter
CMTRANSPORT CMNAME
Description Instruct this transport to pre-register the named listeners. Anticipate a listener from a correspondent with this reusable name. Anticipate a listener for this subject. Wildcard subjects are illegal.
SUBJECT
See Also
268
| Chapter 10
tibrvcmTransport_RemoveListener,
tibrvcmTransport_AllowListener 269
tibrvcmTransport_AllowListener
Function Declaration
CALL tibrvcmTransport_Allowistener USING BY VALUE CMTRANSPORT BY REFERENCE CMNAME RETURNING TIBRV-STATUS END-CALL RVBPALL
Invite the named receiver to reinstate certified delivery for its listeners, superseding the effect of any previous disallow calls. Upon receiving the invitation to reinstate certified delivery, TIBCO Rendezvous for z/OS software at the listening program automatically sends new registration requests. The sending program accepts these requests, restoring certified delivery. Parameter
CMTRANSPORT CMNAME
Remarks
Description Instruct this transport to allow the named listeners. Accept requests for certified delivery to listeners at the transport with this correspondent name.
See Also
270
| Chapter 10
tibrvcmTransport_ConnectToRelayAgent
Function Declaration
CALL tibrvcmTransport_ConnectToRelayAgent USING BY VALUE CMTRANSPORT RETURNING TIBRV-STATUS END-CALL RVBPCRA
Remarks
Programs may specify a relay agent when creating a CM transport. Connect calls are non-blocking; they immediately return control to the program, and asynchronously attempt to connect to the relay agent (continuing until they succeed, or until the program makes a disconnect call). When a transport attempts to connect to a relay agent, TIBCO Rendezvous for z/OS software automatically locates the relay agent process (if it exists). When the program successfully connects to the relay agent, they synchronize: The transport receives a RELAY.CONNECTION advisory, informing it of successful contact with the relay agent. (Listen for all advisory messages on the ordinary tibrvTransport that the tibrvcmTransport employs.) (When a program cannot locate its relay agent, certified delivery software produces DELIVERY.NO_RESPONSE advisories; however, we recommend against designing programs to rely on this side effect.) If the client transport is a CM listener, the relay agent listens to the same set of subjects on behalf of the client. The relay agent also updates its confirmation state to reflect the state of the transport. If the client transport is a CM sender, the relay agent updates its acceptance state to reflect the state of the transport. The sending client updates its confirmation state to reflect the state of the relay agent. The transport and relay agent exchange the labeled data messages that they have been storing during the time they were disconnected.
tibrvcmTransport_ConnectToRelayAgent 271
We recommend that programs remain connected for a minimum of two minutes, to allow time for this synchronization to complete. (Two minutes is a generous estimate, which is sufficient for most situations. Actual time synchronization time can be much shorter, and varies with the number of stored messages and the degree to which protocol state has changed.) If the transport is already connected to its relay agent, then this function returns TIBRV-OK, and does not trigger a RELAY.CONNECTED advisory.
tibrvcmTransport_Create
The error code TIBRV-ARG-CONFLICT can indicate that the transport does not have a relay agent.
tibrvcmTransport_Create,
See Also
tibrvcmTransport_DisconnectFromRelayAgent,
272
| Chapter 10
tibrvcmTransport_Create
Function Declaration
CALL tibrvcmTransport_Create USING BY REFERENCE CMTRANSPORT BY VALUE TRANSPORT BY REFERENCE CMNAME BY VALUE REQUESTOLD BY REFERENCE LEDGERNAME BY VALUE SYNCLEDGER BY VALUE 0 RETURNING TIBRV-STATUS END-CALL RVBPCRE
Create a transport for certified delivery. The new certified delivery transport must employ a valid transport for network communications. (Sheet 1 of 3) Parameter
CMTRANSPORT
Description The program supplies a location, and the function stores the new certified delivery transport in that location. The certified delivery transport remains valid until the program explicitly destroys it.
TRANSPORT
The new cmTransport employs this transport object for network communications. Destroying the cmTransport does not affect this tibrvTransport.
tibrvcmTransport_Create 273
(Sheet 2 of 3) Parameter
CMNAME
Description Bind this reusable name to the new CMTRANSPORT, so the CMTRANSPORT represents a persistent correspondent with this name. If non-NULL, the name must conform to the syntax rules for TIBCO Rendezvous for z/OS subject names. It cannot begin with reserved tokens. It cannot be a non-reusable name generated by another call to tibrvcmTransport_Create. It cannot be the empty string. If this argument is NULL, then tibrvcmTransport_Create generates a unique, non-reusable name for the duration of the transport. For more information, see Name on page 274.
REQUESTOLD
This parameter indicates whether a persistent correspondent requires delivery of messages sent to a previous certified delivery transport with the same name, for which delivery was not confirmed. Its value affects the behavior of other CM sending transports. If this parameter is TIBRV-TRUE and CMNAME is non-NULL, then the new CMTRANSPORT requires certified senders to retain unacknowledged messages sent to this persistent correspondent. When the new CMTRANSPORT begins listening to the appropriate subjects, the senders can complete delivery. (It is an error to supply TIBRV_TRUE when CMNAME is NULL.) If this parameter is TIBRV-FALSE, then the new CMTRANSPORT does not require certified senders to retain unacknowledged messages. Certified senders may delete those messages from their ledgers.
LEDGERNAME
If this argument is non-NULL, then the new CMTRANSPORT uses a file-based ledger. The argument must represent a valid file name. Actual locations corresponding to relative file names conform to operating system conventions. We strongly discourage using the empty string as a ledger file name. If this argument is NULL, then the new CMTRANSPORT uses a process-based ledger. For more information, see Ledger File on page 274.
274
| Chapter 10
(Sheet 3 of 3) Parameter
SYNCLEDGER
Description If this argument is TIBRV-TRUE, then operations that update the ledger file do not return until the changes are written to the storage medium. If this argument is TIBRV-FALSE, the operating system writes changes to the storage medium asynchronously.
Name
If name is NULL, then tibrvcmTransport_Create generates a unique, non-reusable name for the new certified delivery transport. If name is non-NULL, then the new transport binds that name. A correspondent can persist beyond transport destruction only when it has both a reusable name and a file-based ledger. For more information about the use of reusable names, see CM Correspondent Name and Persistent Correspondents in TIBCO Rendezvous Concepts. For details of reusable name syntax, see Reusable Names in TIBCO Rendezvous Concepts.
Relay Agent
tibrvcmTransport_Create
automatically connects a transport to its designated relay agent upon creation; see tibrvcmTransport_ConnectToRelayAgent, page 270.
Ledger File
Every certified delivery transport stores the state of its certified communications in a ledger. If ledgerFile is NULL, then the new transport stores its ledger exclusively in process-based storage. When you destroy the transport or the process terminates, all information in the ledger is lost. If ledgerFile specifies a valid file name, then the new transport uses that file for ledger storage. If the transport is destroyed or the process terminates with incomplete certified communications, the ledger file records that state. When a new transport binds the same reusable name, it reads the ledger file and continues certified communications from the state stored in the file. Even though a transport uses a ledger file, it may sometimes replicate parts of the ledger in process-based storage for efficiency; however, programmers cannot rely on this replication. The SYNCLEDGER parameter determines whether writing to the ledger file is a synchronous operation:
tibrvcmTransport_Create 275
To specify synchronous writing, supply TIBRV-TRUE. Each time TIBCO Rendezvous for z/OS software writes a ledger item, the call does not return until the data is safely stored in the storage medium. To specify asynchronous writing, supply TIBRV-FALSE. CM calls may return before the data is safely stored in the storage medium, which results in greater speed at the cost of certainty. The ledger file might not accurately reflect program state in cases of hardware or operating system kernel failure (but it is accurate in cases sudden program failure). Despite this small risk, we strongly recommend this option for maximum performance. A program that uses an asynchronous ledger file can explicitly synchronize it by calling tibrvcmTransport_SyncLedger on page 298.
Destroying a transport with a file-based ledger always leaves the ledger file intact; it neither erases nor removes a ledger file.
See Also
tibrvcmTransport_Destroy,
tibrvcmTransport_ConnectToRelayAgent,
276
| Chapter 10
tibrvcmTransport_Destroy
Function Declaration
CALL tibrvcmTransport_Destroy USING BY VALUE CMTRANSPORT RETURNING TIBRV-STATUS END-CALL RVBPDES
Remarks
Destroying a certified delivery transport with a file-based ledger always leaves the ledger file intact; it neither erases nor removes a ledger file. This function automatically disconnects the transport from its relay agent before destroying the object; see tibrvcmTransport_DisconnectFromRelayAgent. To destroy a distributed queue transport, call tibrvcmTransport_Destroy.
See Also
tibrvcmTransport_Create,
tibrvcmTransport_DisconnectFromRelayAgent, tibrvcmTransport_CreateDistributedQueue,
tibrvcmTransport_DisallowListener 277
tibrvcmTransport_DisallowListener
Function Declaration
CALL tibrvcmTransport_DisallowListener USING BY VALUE CMTRANSPORT BY REFERENCE CMNAME RETURNING TIBRV-STATUS END-CALL RVBPDAL
Cancel certified delivery to all listeners at a specific correspondent. Deny subsequent certified delivery registration requests from those listeners. Disallowed listeners still receive subsequent messages from this sender, but delivery is not certified. In other words: The listener receives a REGISTRATION.NOT_CERTIFIED advisory, informing it that the sender has canceled certified delivery of all subjects. If the senders ledger contains messages sent to the disallowed listener (for which this listener has not confirmed delivery), then TIBCO Rendezvous for z/OS software removes those ledger items, and does not attempt to redeliver those messages. TIBCO Rendezvous for z/OS software presents subsequent messages (from the canceling sender) to the listener without a sequence number, to indicate that delivery is not certified.
Remarks
Senders can promptly revoke the acceptance of certified delivery by calling within the callback function that processes the REGISTRATION.REQUEST advisory.
tibrvcmTransport_DisallowListener
This function disallows a correspondent by name. If the correspondent terminates, and another process instance (with the same reusable name) takes its place, the new process is still disallowed by this sender.
tibrvcmTransport_AllowListener
Description Instruct this transport to disallow the named listeners. Cancel certified delivery to listeners of the transport with this name.
278
| Chapter 10
See Also
tibrvcmTransport_DisconnectFromRelayAgent 279
tibrvcmTransport_DisconnectFromRelayAgent
Function Declaration
CALL tibrvcmTransport_DisconnectFromRelayAgent USING BY VALUE CMTRANSPORT RETURNING TIBRV-STATUS END-CALL RVBPDFRA
Remarks
Disconnect calls are non-blocking; they immediately return control to the program, and asynchronously proceed with these clean-up tasks: If the client transport is a CM listener, the relay agent attempts to synchronize its listening state with the transport (to assure that the relay agent adequately represents the listening interest of the client). The transport stops communicating with the relay agent. The transport stores subsequent outbound eventsincluding data messages and protocol state changes. If the transport is a certified sender, it cancels its request for delivery confirmation of outstanding unconfirmed messages. (See also, Requesting Confirmation in TIBCO Rendezvous Concepts). The relay agent stores subsequent inbound events for the transport including data messages and protocol state changes. A transport that explicitly disconnects without terminating receives a RELAY.DISCONNECTED advisory, informing it that is safe to sever the physical network connection. (Terminating transports never receive this advisory; instead, it is safe to sever the connection when the destroy call returns.)
tibrvcmTransport_Destroy
Errors
The error code TIBRV-ARG-CONFLICT can indicate that the transport does not have a relay agent.
tibrvcmTransport_ConnectToRelayAgent,
See Also
page 270
tibrvcmTransport_Destroy,
280
| Chapter 10
tibrvcmTransport_GetDefaultCMTimeLimit
Function Declaration
CALL tibrvcmTransport_GetDefaultCMTimeLimit USING BY VALUE CMTRANSPORT BY REFERENCE TIMELIMIT RETURNING TIBRV-STATUS END-CALL RVBPGDCT
Get the default message time limit for all outbound certified messages from a transport. Every labeled message has a time limit, after which the sender no longer certifies delivery. Sending programs can explicitly set the time limit on a message (see tibrvMsg_SetCMTimeLimit on page 303). If a time limit is not already set for the outbound message, the transport sets it to the transports default time limit (extractable with this function); if this default is not set for the transport (nor for the message), the default time limit is zero (no time limit). Time limits represent the minimum time that certified delivery is in effect. Parameter
CMTRANSPORT TIMELIMIT
Remarks
Description Set the default message time limit of this transport. The program supplies a location, and the function stores the default time limit (in whole seconds) in that location. page 297
See Also
tibrvcmTransport_SetDefaultCMTimeLimit, tibrvMsg_SetCMTimeLimit,
page 303
tibrvcmTransport_GetLedgerName 281
tibrvcmTransport_GetLedgerName
Function Declaration
CALL tibrvcmTransport_GetLedgerName USING BY VALUE CMTRANSPORT BY REFERENCE LEDGERNAME RETURNING TIBRV-STATUS END-CALL RVBPPGLN
Description Extract the ledger name from this certified delivery transport object. The program supplies a location, and the function stores the ledger name in that location.
LEDGERNAME
Errors
The error code TIBRV-ARG-CONFLICT can indicate that the transport does not have a ledger file. Ledger File, page 274
tibrvcmTransport_Create,
See Also
page 272
282
| Chapter 10
tibrvcmTransport_GetName
Function Declaration
CALL tibrvcmTransport_GetName USING BY VALUE CMTRANSPORT BY REFERENCE CMNAME RETURNING TIBRV-STATUS END-CALL RVBPGNAM
Description Extract the name from this certified delivery transport object. The program supplies a location, and the function stores the correspondent name in that location.
See Also
page 272
tibrvcmTransport_GetRelayAgent 283
tibrvcmTransport_GetRelayAgent
Function Declaration
CALL tibrvcmTransport_GetRelayAgent USING BY VALUE CMTRANSPORT BY REFERENCE RELAYAGENT RETURNING TIBRV-STATUS END-CALL RVBPGRA
Extract the name of the relay agent used by a certified delivery transport. Parameter
CMTRANSPORT
Description Extract the relay agent from this certified delivery transport object. The program supplies a location, and the function stores the name of the relay agent in that location.
RELAYAGENT
Errors
The error code TIBRV-ARG-CONFLICT can indicate that the transport does not have a relay agent. Relay Agent, page 274
tibrvcmTransport_Create,
See Also
page 272
284
| Chapter 10
tibrvcmTransport_GetRequestOld
Function Declaration
CALL tibrvcmTransport_GetRequestOld USING BY VALUE CMTRANSPORT BY REFERENCE REQUESTOLD RETURNING TIBRV-STATUS END-CALL RVBPGRO
Extract the request old messages flag of a certified delivery transport. Parameter
CMTRANSPORT
Description Extract the request old messages flag from this certified delivery transport object. The program supplies a location, and the function stores the request old messages flag in that location.
REQUESTOLD
See Also
REQUESTOLD,
tibrvcmTransport_Create,
tibrvcmTransport_GetSyncLedger 285
tibrvcmTransport_GetSyncLedger
Function Declaration
CALL tibrvcmTransport_GetSyncLedger USING BY VALUE CMTRANSPORT BY REFERENCE SYNCLEDGER RETURNING TIBRV-STATUS END-CALL RVBPGSL
Description Extract the sync ledger flag from this certified delivery transport object. The program supplies a location, and the function stores the sync ledger flag in that location.
SYNCLEDGER
Errors
The error code TIBRV-ARG-CONFLICT can indicate that the transport does not have a ledger file. Ledger File, page 274
tibrvcmTransport_Create,
See Also
page 272
286
| Chapter 10
tibrvcmTransport_GetTransport
Function Declaration
CALL tibrvcmTransport_GetTransport USING BY VALUE CMTRANSPORT BY REFERENCE TRANSPORT RETURNING TIBRV-STATUS END-CALL RVBPGTR
Description Extract the transport from this certified delivery transport object. The program supplies a location, and the function stores the transport in that location. page 272
TRANSPORT
See Also
tibrvcmTransport_Create,
tibrvcmTransport_RemoveListener 287
tibrvcmTransport_RemoveListener
Function Declaration
CALL tibrvcmTransport_RemoveListener USING BY VALUE CMTRANSPORT BY REFERENCE CMNAME BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBPRLS
Unregister a specific listener at a specific correspondent, and free associated storage in the senders ledger. This function cancels certified delivery of the specific subject to the correspondent with this name. The listening correspondent may subsequently re-register for certified delivery of the subject. (In contrast, tibrvcmTransport_DisallowListener cancels certified delivery of all subjects to the correspondent, and prohibits re-registration.) Senders can call this function when the ledger item for a listening correspondent has grown very large. Such growth indicates that the listener is not confirming delivery, and may have terminated. Removing the listener reduces the ledger size by deleting messages stored for the listener. When a sending program calls this function, certified delivery software in the sender behaves as if the listener had closed the endpoint for the subject. The sending program deletes from its ledger all information about delivery of the subject to the correspondent with this CMNAME. The sending program receives a REGISTRATION.CLOSED advisory, to trigger any operations in the callback function for the advisory. If the listening correspondent is available (running and reachable), it receives a advisory, informing it that the sender no longer certifies delivery of the subject.
REGISTRATION.NOT_CERTIFIED
Remarks
If the correspondent with this name does not receive certified delivery of the subject from this sender CMTRANSPORT, then tibrvcmTransport_RemoveListener returns the status code TIBRV-INVALID-SUBJECT. Parameter
CMTRANSPORT
288
| Chapter 10
Parameter
CMNAME
Description Cancel certified delivery of the subject to listeners of this correspondent. Cancel certified delivery of this subject to the named listener. Wildcard subjects are illegal.
SUBJECT
See Also
Name, page 274 page 267 page 277 Canceling Certified Delivery in TIBCO Rendezvous Concepts
tibrvcmTransport_DisallowListener, tibrvcmTransport_AddListener,
tibrvcmTransport_RemoveSendState 289
tibrvcmTransport_RemoveSendState
Function Declaration
CALL tibrvcmTransport_RemoveSendState USING BY VALUE CMTRANSPORT BY REFERENCE SUBJECT RETURNING TIBRV-STATUS END-CALL RVBPRSS
Reclaim ledger space from obsolete subjects. In some programs subject names are useful only for a limited time; after that time, they are never used again. For example, consider a server program that sends certified reply messages to client inbox names; it only sends one reply message to each inbox, and after delivery is confirmed and complete, that inbox name is obsolete. Nonetheless, a record for that inbox name remains in the servers ledger. As such obsolete records accumulate, the ledger size grows. To counteract this growth, programs can use this function to discard obsolete subject records from the ledger. The DELIVERY.COMPLETE advisory is a good opportunity to clear the send state of an obsolete subject. Another strategy is to review the ledger periodically, sweeping to detect and remove all obsolete subjects.
Remarks
Do not use this function to clear subjects that are still in use. As a side-effect, this function resets the sequence numbering for the subject, so the next message sent on the subject would be number 1. In proper usage, this side-effect is never detected, since obsolete subjects are truly obsolete.
Parameter
CMTRANSPORT
Description Remove send state from the ledger of this certified delivery transport. Remove send state for this obsolete subject.
SUBJECT
See Also
tibrvcmTransport_ReviewLedger, tibrvcmTransport_Send,
290
| Chapter 10
tibrvcmTransport_ReviewLedger
Function Declaration
CALL tibrvcmTransport_ReviewLedger USING BY VALUE CMTRANSPORT BY VALUE CALLBACK BY REFERENCE SUBJECT BY REFERENCE CLOSURE RETURNING TIBRV-STATUS END-CALL RVBPRLG
Query the ledger for stored items related to a subject name. The callback function receives one message for each matching subject stored in the ledger. For example, when FOO.* is the subject, tibrvcmTransport_ReviewLedger calls its callback function separately for each matching subjectonce for FOO.BAR, once for FOO.BAZ, and once for FOO.BOX. However, if the callback function returns non-NULL, then tibrvcmTransport_ReviewLedger returns immediately. If the ledger does not contain any matching items, tibrvcmTransport_ReviewLedger returns normally without calling the callback function. For information about the content and format of the callback messages, see tibrvcmReviewCallback on page 291. Parameter
CMTRANSPORT CALLBACK SUBJECT
Description Review the ledger of this transport. This function receives the review messages. Query for items related to this subject name. If this subject contains wildcard characters ("*" or ">"), then review all items with matching subject names. The callback function receives a separate message for each matching subject in the ledger.
CLOSURE
See Also
tibrvcmReviewCallback,
tibrvcmReviewCallback 291
tibrvcmReviewCallback
Function Type Declaration
ENTRY BY BY BY BY tibrvcmReviewCallback VALUE CMTRANSPORT, VALUE SUBJECT, VALUE MESSAGE, VALUE CLOSURE. Using
Purpose
Programs define functions of this type to process ledger review summary messages.
tibrvcmTransport_ReviewLedger calls this callback function once for each matching subject stored in the ledger.
Remarks
To continue reviewing the ledger, return NULL from this callback function. To stop reviewing the ledger, return non-NULL from this callback function; tibrvcmTransport_ReviewLedger cancels the review and returns immediately. Parameter
CMTRANSPORT SUBJECT MESSAGE
Description This parameter receives the transport. This parameter receives the subject for this ledger item. This parameter receives a summary message describing the delivery status of messages in the ledger. The table below describes the fields of the summary message. This parameter receives closure data which the program supplied to tibrvcmTransport_ReviewLedger.
CLOSURE
Message Fields
This callback function receives ledger summary messages with these fields.
Description The subject that this message summarizes. This field has datatype TIBRVMSG-STRING.
SEQNO-LAST-SENT
The sequence number of the most recent message sent with this subject name. This field has datatype TIBRVMSG-U64.
292
| Chapter 10
Description The total number of messages stored at this subject name. This field has datatype TIBRVMSG-U32.
TOTAL-SIZE
The total storage (in bytes) occupied by all messages with this subject name. If the ledger contains several messages with this subject name, then this field sums the storage space over all of them. This field has datatype TIBRVMSG-U64.
LISTENER
Each summary message can contain one or more fields named listener. Each listener field contains a nested submessage with details about a single registered listener. This field has datatype TIBRVMSG-MSG.
LISTENER.NAME
Within each listener submessage, the name field contains the name of the listener transport. This field has datatype TIBRVMSG-STRING.
LISTENER.LAST-CONFIRMED
Within each listener submessage, the last_confirmed field contains the sequence number of the last message for which the listener confirmed delivery. This field has datatype TIBRVMSG-U64.
See Also
tibrvcmTransport_ReviewLedger,
page 290
tibrvcmTransport_Send 293
tibrvcmTransport_Send
Function Declaration
CALL tibrvcmTransport_Send USING BY VALUE CMTRANSPORT BY VALUE MESSAGE RETURNING TIBRV-STATUS END-CALL RVBPSEND
Send a labeled message. This function sends the message, along with its certified delivery protocol information: the correspondent name of the tibrvcmTransport, a sequence number, and a time limit. The protocol information remains on the message within the sending program, and also travels with the message to all receiving programs. Programs can explicitly set the message time limit; see on page 303. If a time limit is not already set for the outbound message, this function sets it to the transports default time limit (see tibrvcmTransport_SetDefaultCMTimeLimit on page 297); if that default is not set for the transport, the default time limit is zero (no time limit).
tibrvMsg_SetCMTimeLimit
Parameter
CMTRANSPORT MESSAGE
Description Send a message using this certified delivery transport. Send this message. Wildcard subjects are illegal.
See Also
tibrvcmTransport_SendReply,
tibrvcmTransport_SendRequest, tibrvMsg_SetCMTimeLimit,
tibrvcmTransport_SetDefaultCMTimeLimit,
page 303
294
| Chapter 10
tibrvcmTransport_SendReply
Function Declaration
CALL tibrvcmTransport_SendReply USING BY VALUE CMTRANSPORT BY REFERENCE REPLYMESSAGE BY REFERENCE REQUESTMESSAGE RETURNING TIBRV-STATUS END-CALL RVBPSRP
Send a labeled reply message. This convenience call extracts the reply subject of an inbound request message, and sends a labeled outbound reply message to that subject. In addition to the convenience, this call is marginally faster than using separate calls to extract the subject and send the reply. This function can send a labeled reply to an ordinary message. This function automatically registers the requesting CM transport, so the reply message is certified. Give special attention to the order of the arguments to this method. Reversing the inbound and outbound messages can cause an infinite loop, in which the program repeatedly resends the inbound message to itself (and all other recipients). Parameter
CMTRANSPORT REPLYMESSAGE REQUESTMESSAGE
Description Send a message using this certified delivery transport. Send this outbound reply message. Send a reply to this inbound request message; extract its reply subject to use as the subject of the outbound reply message. If this message has a wildcard reply subject, the function produces an error.
See Also
tibrvcmTransport_Send,
tibrvcmTransport_SendRequest,
tibrvcmTransport_SendRequest 295
tibrvcmTransport_SendRequest
Function Declaration
CALL tibrvcmTransport_SendRequest USING BY VALUE CMTRANSPORT BY REFERENCE MESSAGE BY REFERENCE REPLY BY VALUE TIMEOUT RETURNING TIBRV-STATUS END-CALL RVBPSRQ
Send a labeled request message and wait for a reply. Blocking can Stall Event Dispatch This call blocks all other activity on its program thread. If appropriate, programmers must ensure that other threads continue dispatching events on its queues. Parameter
CMTRANSPORT MESSAGE
Description Send a message using this certified delivery transport. Send this request message. Wildcard subjects are illegal.
REPLY
The program supplies a location, and the function stores the inbound reply in that location. The program need not create the reply message, nor allocate space for it. However, the program must destroy the reply message, even though it did not create it.
TIMEOUT
Maximum time (in seconds) that this call can block while waiting for a reply.
TIBRV_WAIT_FOREVER
Programs that receive and process the request message cannot determine that the sender has blocked until a reply arrives. The sender and receiver must already have a certified delivery agreement, otherwise the request is not certified.
296
| Chapter 10
The request message must have a valid destination subject; see tibrvMsg_SetSendSubject on page 98. A certified request does not necessarily imply a certified reply; the replying program determines the type of reply message that it sends.
Operation
This function operates in several synchronous steps: 1. Create a tibrvcmEvent that listens for messages on the reply subject of message. 2. Label and send the outbound message. 3. Block until the listener receives a reply; if the time limit expires before a reply arrives, return the status code TIBRV-TIMEOUT. (The reply event uses a private queue that is not accessible to the program.) 4. Store the reply in the location specified by the reply parameter. 5. Return.
See Also
tibrvcmTransport_Send,
tibrvcmTransport_SendReply,
tibrvcmTransport_SetDefaultCMTimeLimit 297
tibrvcmTransport_SetDefaultCMTimeLimit
Function Declaration
CALL tibrvcmTransport_SetDefaultCMTimeLimit USING BY VALUE CMTRANSPORT BY VALUE TIMELIMIT RETURNING TIBRV-STATUS END-CALL RVBPSDCT
Set the default message time limit for all outbound certified messages from a transport. Every labeled message has a time limit, after which the sender no longer certifies delivery. Sending programs can explicitly set the time limit on a message (see tibrvMsg_SetCMTimeLimit on page 303). If a time limit is not already set for the outbound message, this function sets it to the transports default time limit (set with this function); if this default is not set for the transport, the default time limit is zero (no time limit). Time limits represent the minimum time that certified delivery is in effect. Parameter
CMTRANSPORT TIMELIMIT
Remarks
Description Set the default message time limit of this transport. Use this time limit (in whole seconds). The time limit must be non-negative. page 280
See Also
tibrvcmTransport_GetDefaultCMTimeLimit, tibrvMsg_SetCMTimeLimit,
page 303
298
| Chapter 10
tibrvcmTransport_SyncLedger
Function Declaration
CALL tibrvcmTransport_SyncLedger USING BY VALUE CMTRANSPORT RETURNING TIBRV-STATUS END-CALL RVBPSLG
Synchronize the ledger to it its storage medium. When this function returns, the transports current state is safely stored in the ledger file. Transports that use synchronous ledger files need not call this function, since the current state is automatically written to the file system before returning. Transports that use process-based ledger storage need not call this function, since they have no ledger file. Parameter
CMTRANSPORT
Description Synchronize the ledger file of this certified delivery transport object.
Errors
The error code TIBRV-INVALID-ARG can indicate that the transport does not have a ledger file. Ledger File, page 274
tibrvcmTransport_Create, tibrvcmTransport_GetSyncLedger,
See Also
tibrvMsg_GetCMSender 299
tibrvMsg_GetCMSender
Function Declaration
CALL tibrvcmTransport_GetSender USING BY VALUE MESSAGE BY REFERENCE NAME RETURNING TIBRV-STATUS END-CALL RVBMGCSN
Extract the correspondent name of the sender from a certified message. Parameter
MESSAGE NAME
Description Extract the sender name from this message. The program supplies a location. The function stores the name in that location.
Status
This function returns a status code that discriminates between labeled messages and other messages. If the message is from a CM sender, then tibrvMsg_GetCMSender returns the status code TIBRV-OK and yields a valid CM correspondent name. If the message is not from a CM sender, then tibrvMsg_GetCMSender returns the status code TIBRV-NOT-FOUND. page 272 page 282
See Also
tibrvcmTransport_Create,
tibrvcmTransport_GetName,
300
| Chapter 10
tibrvMsg_GetCMSequence
Function Declaration
CALL tibrvMsg_GetCMSequence USING BY VALUE MESSAGE BY REFERENCE SEQUENCNUMBER RETURNING TIBRV-STATUS END-CALL RVBGCSQ
Extract the sequence number from a certified message. TIBCO Rendezvous for z/OS certified delivery sending functions automatically generate positive sequence numbers for outbound labeled messages. Parameter
MESSAGE SEQUENCENUMBER
Description Extract the sequence number from this message. The program supplies a location. The function stores the sequence number in that location.
Status
This function returns a status code that discriminates between certified messages (with a certified delivery agreement) and other messages. If the message is from a CM sender, and the CM listener is registered for certified delivery with that sender, then tibrvMsg_GetCMSequence returns the status code TIBRV-OK and yields a valid sequence number. If the message is from a CM sender, but the listener is not registered for certified delivery, then tibrvMsg_GetCMSequence in the context of a tibrvcmEventCallback function returns the status code TIBRV-NOT-FOUND. (In any other context, it returns the actual sequence number stored on the message.) Notice that the first labeled message that a program receives on a subject might not be certified; that is, the sender has not registered a certified delivery agreement with the listener. If appropriate, the certified delivery library automatically requests that the sender register the listener for certified delivery. (See Discovery and Registration for Certified Delivery in TIBCO Rendezvous Concepts). A labeled but uncertified message can also result when the sender explicitly disallows or removes the listener. If the message is not from a CM sender, then tibrvMsg_GetCMSequence (in any context) returns the status code TIBRV-NOT-FOUND.
tibrvMsg_GetCMSequence 301
Release 5 Interaction
In release 6 (and later) the sequence number is a 64-bit unsigned integer, while in older releases (5 and earlier) it is a 32-bit unsigned integer. When 32-bit senders overflow the sequence number, behavior is undefined. When 64-bit senders send sequence numbers greater than 32 bits, 32-bit receivers detect malformed label information, and process the message as an ordinary reliable message (uncertified and unlabeled).
See Also
tibrvcmTransport_Send,
page 293
302
| Chapter 10
tibrvMsg_GetCMTimeLimit
Function Declaration
CALL tibrvMsg_GetCMTimeLimit USING BY REFERENCE MESSAGE BY REFERENCE TIMELIMIT RETURNING TIBRV-STATUS END-CALL RVBMGCTL
Extract the message time limit from a certified message. Programs can explicitly set the message time limit (see tibrvMsg_SetCMTimeLimit on page 303). Zero is a special value, indicating no time limit.
TIBRV-NOT-FOUND.
If a time limit is not set for a message, this function returns the status code This situation can occur only for unsent outbound messages, and for inbound unlabeled messages. Time limits represent the minimum time that certified delivery is in effect. This value represents the total time limit of the message, not the time remaining. Parameter
MESSAGE TIMELIMIT
Description Extract the time limit from this message. The program supplies a location. The function stores the time limit in that location. page 293 page 303
See Also
tibrvcmTransport_Send,
tibrvMsg_SetCMTimeLimit,
tibrvMsg_SetCMTimeLimit 303
tibrvMsg_SetCMTimeLimit
Function Declaration
CALL tibrvMsg_SetCMTimeLimit USING BY REFERENCE MESSAGE BY REFERENCE TIMELIMIT RETURNING TIBRV-STATUS END-CALL RVBMSCTL
Set the message time limit of a certified message. Every labeled message has a time limit, after which the sender no longer certifies delivery. Sending programs can explicitly set the message time limit using this function. If a time limit is not already set for the outbound message, tibrvcmTransport_Send sets it to the transports default time limit (see tibrvcmTransport_SetDefaultCMTimeLimit on page 297); if that default is not set for the transport, the default time limit is zero (no time limit). Time limits represent the minimum time that certified delivery is in effect. It is meaningless for receiving programs to call this function.
Parameters
Parameter
MESSAGE TIMELIMIT
Description Set the time limit of this message. Use this time limit (in whole seconds) for the message. The time limit must be non-negative. page 280 page 297
See Also
page 302
304
| Chapter 10
| 305
Chapter 11
Distributed Queues
Programs can use distributed queues for one of n certified delivery to a group of worker processes.
Topics
Operations in Alphabetical Order, page 306 Distributed Queue Overview, page 307
306
| Chapter 11
Distributed Queues
Description Create a distributed queue member. Extract the worker complete time limit of a distributed queue transport. Extract the worker weight of a distributed queue transport. Extract the worker task capacity of a distributed queue transport. Set the worker complete time limit of a distributed queue transport. Set the worker weight of a distributed queue transport. Set the worker task capacity of a distributed queue transport.
tibrvcmTransport_GetWorkerWeight
tibrvcmTransport_GetWorkerTasks
tibrvcmTransport_SetCompleteTime
tibrvcmTransport_SetWorkerWeight
tibrvcmTransport_SetWorkerTasks
308
| Chapter 11
Distributed Queues
tibrvcmTransport_CreateDistributedQueue
Function Declaration
CALL tibrvcmTransport_CreateDistributedQueue USING BY REFERENCE CMTRANSPORT BY VALUE TRANSPORT BY REFERENCE CMNAME RETURNING TIBRV-STATUS END-CALL RVBPCDQ CALL tibrvcmTransport_CreateDistributedQueueEx USING BY REFERENCE CMTRANSPORT BY VALUE TRANSPORT BY REFERENCE CMNAME BY VALUE WORKERWEIGHT BY VALUE WORKERTASKS BY VALUE SCHEDULERWEIGHT BY VALUE SCHEDULERHEARTBEAT BY VALUE SCHEDULERACTIVATION RETURNING TIBRV-STATUS END-CALL
Short Name
RVBPCDQX
Create a distributed queue member. The new distributed queue transport must employ a valid transport for network communications. All members of a distributed queue must listen to exactly the same set of subjects. See Enforcing Identical Subscriptions in TIBCO Rendezvous Concepts. To destroy a distributed queue transport, call tibrvcmTransport_Destroy.
(Sheet 1 of 3) Parameter
CMTRANSPORT
Description The program supplies a location, and the function stores the new distributed queue transport in that location. The distributed queue transport remains valid until the program explicitly destroys it.
tibrvcmTransport_CreateDistributedQueue 309
(Sheet 2 of 3) Parameter
TRANSPORT
Description The new distributed CMTRANSPORT employs this transport object for network communications. Destroying the distributed CMTRANSPORT does not affect this transport. The program must explicitly call tibrvTransport_Destroy to destroy this tibrvTransport when it is no longer needed.
CMNAME
Bind this reusable name to the new distributed CMTRANSPORT, so the distributed queue transport becomes a member of the distributed queue with this name. The name must be non-NULL, and conform to the syntax rules for TIBCO Rendezvous for z/OS subject names. It cannot begin with reserved tokens. It cannot be a non-reusable name generated by a call to tibrvcmTransport_Create. It cannot be the empty string. For more information, see Reusable Names in TIBCO Rendezvous Concepts.
WORKERWEIGHT
When the scheduler receives a task, it assigns the task to the available worker with the greatest worker weight. A worker is considered available unless either of these conditions are true: The pending tasks assigned to the worker member exceed its task capacity. The worker is also the scheduler. (The scheduler assigns tasks to its own worker role only when no other workers are available.)
Programs can set this parameter using the extended function. The brief form supplies the default value, TIBRVCM-DEFAULT-WORKER-WEIGHT (1).
310
| Chapter 11
Distributed Queues
(Sheet 3 of 3) Parameter
WORKERTASKS
Description Task capacity is the maximum number of tasks that a worker can accept. When the number of accepted tasks reaches this maximum, the worker cannot accept additional tasks until it completes one or more of them. When the scheduler receives a task, it assigns the task to the worker with the greatest worker weightunless the pending tasks assigned to that worker exceed its task capacity. When the preferred worker has too many tasks, the scheduler assigns the new inbound task to the worker with the next greatest worker weight. The default worker task capacity is 1. Value must be greater than zero.
Tuning task capacity to compensate for communication time lag is more complicated than it might seem. Before setting this value to anything other than 1, see Task Capacity in TIBCO Rendezvous Concepts.
SCHEDULERWEIGHT
Weight represents the ability of this member to fulfill the role of scheduler, relative to other members with the same name. Cooperating distributed queue transports use relative scheduler weight values to elect one transport as the scheduler; members with higher scheduler weight take precedence. Acceptable values range from 1 to 65535. For more information, see Rank and Weight in TIBCO Rendezvous Concepts.
SCHEDULERHEARTBEAT
The scheduler sends heartbeat messages at this interval (in seconds). All members with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts.
SCHEDULERACTIVATION
When the heartbeat signal from the scheduler has been silent for this interval (in seconds), the member with the greatest scheduler weight takes its place as the new scheduler. All members with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Choose the Intervals in TIBCO Rendezvous Concepts.
tibrvcmTransport_CreateDistributedQueue 311
Constant
TIBRVCM-DEFAULT-COMPLETE-TIME TIBRVCM-DEFAULT-WORKER-WEIGHT TIBRVCM-DEFAULT-WORKER-TASKS TIBRVCM-DEFAULT-SCHEDULER-WEIGHT TIBRVCM-DEFAULT-SCHEDULER-HB TIBRVCM-DEFAULT-SCHEDULER-ACTIVE
Value
0 1 1 1 1.0 3.5
Relationship to CM
Although distributed queue members are a specialized type of CM transport, their behavior is quite different. They do not support any functions related to sending certified messages (for a complete list, see the table of disabled functions, below). Scheduler recovery and task rescheduling are available only when the task message is a certified message (that is, a certified delivery agreement is in effect between the task sender and the distributed queue transport scheduler). Disabled Functions
tibrvcmTransport_AddListener tibrvcmTransport_AllowListener tibrvcmTransport_ConnectToRelayAgent tibrvcmTransport_DisallowListener tibrvcmTransport_DisconnectFromRelayAgent tibrvcmTransport_GetDefaultCMTimeLimit tibrvcmTransport_GetLedgerName tibrvcmTransport_GetRelayAgent tibrvcmTransport_GetRequestOld tibrvcmTransport_GetSyncLedger tibrvcmTransport_RemoveListener tibrvcmTransport_RemoveSendState tibrvcmTransport_ReviewLedger tibrvcmTransport_Send tibrvcmTransport_SendReply tibrvcmTransport_SendRequest tibrvcmTransport_SetDefaultCMTimeLimit tibrvcmTransport_SyncLedger
312
| Chapter 11
Distributed Queues
See Also
tibrvcmTransport_GetCompleteTime 313
tibrvcmTransport_GetCompleteTime
Function Declaration
CALL tibrvcmTransport_GetCompleteTime USING BY VALUE CMTRANSPORT BY REFERENCE COMPLETETIME RETURNING TIBRV-STATUS END-CALL RVBPGCT
Extract the worker complete time limit of a distributed queue transport. The complete time parameter of the scheduler affects the reassignment of tasks. Parameter
CMTRANSPORT COMPLETETIME
Description Set the complete time of this distributed queue transport. The program supplies a location, and the function stores the worker complete time in that location.
See Also
tibrvcmTransport_SetCompleteTime,
314
| Chapter 11
Distributed Queues
tibrvcmTransport_GetWorkerWeight
Function Declaration
CALL tibrvcmTransport_GetWokerWeight USING BY VALUE CMTRANSPORT BY REFERENCE WORKERWEIGHT RETURNING TIBRV-STATUS END-CALL RVBPGWW
Description Set the worker weight of this distributed queue transport. The program supplies a location, and the function stores the worker weight in that location.
See Also
Distributed Queue in TIBCO Rendezvous Concepts tibrvcmTransport_CreateDistributedQueue, page 308 tibrvcmTransport_SetWorkerWeight, page 317
tibrvcmTransport_GetWorkerTasks 315
tibrvcmTransport_GetWorkerTasks
Function Declaration
CALL tibrvcmTransport_GetWorkerTasks USING BY VALUE CMTRANSPORT BY REFERENCE WORKERTASKS RETURNING TIBRV-STATUS END-CALL RVBPGWT
Description Set the task capacity of this distributed queue transport. Use this task capacity.
See Also
Distributed Queue in TIBCO Rendezvous Concepts tibrvcmTransport_CreateDistributedQueue, page 308 tibrvcmTransport_SetWorkerTasks, page 318
316
| Chapter 11
Distributed Queues
tibrvcmTransport_SetCompleteTime
Function Declaration
CALL tibrvcmTransport_SetCompleteTime USING BY VALUE CMTRANSPORT BY REFERENCE COMPLETETIME RETURNING TIBRV-STATUS END-CALL RVBPSCT
Set the worker complete time limit of a distributed queue transport. The complete time parameter of the scheduler affects the reassignment of tasks: If the complete time is non-zero, the scheduler waits for a worker member to complete an assigned task. If the complete time elapses before the scheduler receives completion from the worker member, the scheduler reassigns the task to another worker member. Zero is a special value, which specifies no limit on the completion timethat is, the scheduler does not set a timer, and does not reassign tasks when task completion is lacking. All members implicitly begin with a default complete time value of zero; programs can change this parameter using this function. Parameter
CMTRANSPORT COMPLETETIME
Description Set the complete time of this distributed queue transport. Use this complete time (in seconds). The time must be non-negative.
See Also
tibrvcmTransport_GetCompleteTime,
page 313 Distributed Queue in TIBCO Rendezvous Concepts Complete Time in TIBCO Rendezvous Concepts
tibrvcmTransport_SetWorkerWeight 317
tibrvcmTransport_SetWorkerWeight
Function Declaration
CALL tibrvcmTransport_SetWokerWeight USING BY VALUE CMTRANSPORT BY VALUE WORKERWEIGHT RETURNING TIBRV-STATUS END-CALL RVBPSWW
Set the worker weight of a distributed queue transport. Relative worker weights assist the scheduler in assigning tasks. When the scheduler receives a task, it assigns the task to the available worker with the greatest worker weight. The default worker weight is 1; programs can set this parameter at creation using tibrvcmTransport_CreateDistributedQueue, or change it dynamically using this function. Parameter
CMTRANSPORT WORKERWEIGHT
Description Set the worker weight of this distributed queue transport. Use this worker weight.
See Also
Distributed Queue in TIBCO Rendezvous Concepts tibrvcmTransport_CreateDistributedQueue, page 308 tibrvcmTransport_GetWorkerWeight, page 314
318
| Chapter 11
Distributed Queues
tibrvcmTransport_SetWorkerTasks
Function Declaration
CALL tibrvcmTransport_SetWorkerTasks USING BY VALUE CMTRANSPORT BY VALUE WORKERTASKS RETURNING TIBRV-STATUS END-CALL RVBPSWT
Set the worker task capacity of a distributed queue transport. Task capacity is the maximum number of tasks that a worker can accept. When the number of accepted tasks reaches this maximum, the worker cannot accept additional tasks until it completes one or more of them. When the scheduler receives a task, it assigns the task to the worker with the greatest worker weightunless the pending tasks assigned to that worker exceed its task capacity. When the preferred worker has too many tasks, the scheduler assigns the new inbound task to the worker with the next greatest worker weight. The default worker task capacity is 1. Tuning task capacity to compensate for communication time lag is more complicated than it might seem. Before setting this value to anything other than 1, see Task Capacity in TIBCO Rendezvous Concepts.
Parameter
cmTransport WORKERTASKS
Description Set the task capacity of this distributed queue transport. Use this task capacity. Value must be greater than zero.
See Also
Distributed Queue in TIBCO Rendezvous Concepts tibrvcmTransport_CreateDistributedQueue, page 308 tibrvcmTransport_GetWorkerTasks, page 315
| 319
Chapter 12
Datatypes
TIBCO Rendezvous for z/OS wire format datatypes are a standard, platform-independent convention for types and sizes. A parallel set of C datatypes represents data within programs. This chapter summarizes the two sets of datatypes, and the conversions among the various types. See also, Appendix A, Custom Datatypes, on page 331.
Topics
Wire Format Datatypes, page 320 Datatype Conversion, page 322
320
| Chapter 12
Datatypes
Type Description
Notes
TIBCO Rendezvous for z/OS message TIBCO Rendezvous for z/OS datetime opaque byte sequence ISO 8859-1 character string (also called Latin-1) XML data (byte sequence)
NULL-terminated.
TIBRVMSG-DATETIME
TIBRVMSG-OPAQUE TIBRVMSG-STRING
TIBRVMSG-XML
Scalar Types
TIBRVMSG-BOOL TIBRVMSG-I8 TIBRVMSG-I16 TIBRVMSG-I32 TIBRVMSG-I64 TIBRVMSG-U8 TIBRVMSG-U16 TIBRVMSG-U32 TIBRVMSG-U64 TIBRVMSG-F32 TIBRVMSG-F64
boolean 8-bit integer 16-bit integer 32-bit integer 64-bit integer 8-bit unsigned integer 16-bit unsigned integer 32-bit unsigned integer 64-bit unsigned integer 32-bit floating point 64-bit floating point
TIBRV-FALSE, TIBRV-TRUE
TIBRVMSG-IPPORT16
2-byte IP port
Array Types
TIBRVMSG-I8ARRAY TIBRVMSG-I16ARRAY TIBRVMSG-I32ARRAY TIBRVMSG-I64ARRAY TIBRVMSG-U8ARRAY TIBRVMSG-U16ARRAY TIBRVMSG-U32ARRAY TIBRVMSG-U64ARRAY TIBRVMSG-F32ARRAY TIBRVMSG-F64ARRAY
8-bit integer array 16-bit integer array 32-bit integer array 64-bit integer array 8-bit unsigned integer array 16-bit unsigned integer array 32-bit unsigned integer array 64-bit unsigned integer array 32-bit floating point array 64-bit floating point array
The count property of the field reflects the number of elements in the array.
Custom Types
TIBRVMSG-USER-FIRST
First code available for custom datatypes. Last code available for custom datatypes.
TIBRVMSG-USER-LAST
322
| Chapter 12
Datatypes
Datatype Conversion
TIBCO Rendezvous for z/OS software converts datatypes in two situations: As it translates a message to wire format (when sending a message). As it extracts data from a message field.
Convenience functions that extract a field from a TIBCO Rendezvous for z/OS message automatically decode the fields data to a homologous COBOL type. Convenience functions that add a field to a TIBCO Rendezvous for z/OS message or update an existing field severely restrict type encoding. These functions encode only to homologous types.
General Rules
These general rules govern most conversions. Supported All wire format types decode to the homologous COBOL datatypes (in get calls), and all COBOL datatypes encode to the homologous wire format types (in add and update calls). All wire format numeric scalar types convert to all COBOL numeric scalar types. All wire format numeric array types convert to all COBOL numeric array types.
Caution Converting a wire format opaque or XML byte sequence to a COBOL character string creates a printable string, but the string does not capture any of the data bytes (it captures only the number of bytes). Converting a wire format signed integer to a COBOL unsigned integer discards the sign. Converting a wire format numeric type to a COBOL numeric type with fewer bits risks loss of precision. Converting wire format floating point numbers to COBOL integer types discards the fractional part.
Converting large (out-of-range) wire format floating point numbers to COBOL integers results in the maximum integer of the COBOL target size.
Not Supported Array types do not convert to scalar types. Scalar types do not convert to array types. COBOL types do not convert to non-homologous wire format types (when adding or updating a field).
324
| Chapter 12
Datatypes
| 325
Chapter 13
Status
Most TIBCO Rendezvous for z/OS functions return a status code, indicating either normal return status or a range of error conditions. Programs must check the status after every TIBCO Rendezvous for z/OS function call, and take appropriate action.
Topics
Function
Status Codes
tibrv-status
Description
Page
Enumerated return codes from TIBCO Rendezvous for z/OS functions. Return the descriptive string corresponding to a status code.
326
tibrvStatus_GetText
330
326
| Chapter 13
Status
tibrv-status
Type Purpose
(Sheet 1 of 4) Constant
TIBRV-OK TIBRV-INIT-FAILURE TIBRV-INVALID-TRANSPORT TIBRV-INVALID-ARG
Description The function returned without error. Cannot create the network transport. The transport has been destroyed, or is otherwise unusable. An argument is invalid. Check arguments other than messages, subject names, transports, events, queues and queue groups (which have separate status codes). The function cannot run because the TIBCO Rendezvous for z/OS environment is not initialized (open). Two arguments that require a specific relation are in conflict. For example, the upper end of a numeric range is less than the lower end.
tibrvTransport_Create
TIBRV-NOT-INITIALIZED
TIBRV-ARG-CONFLICT
TIBRV-SERVICE-NOT-FOUND
cannot match the service name cannot match the network name cannot match the daemon port
using getservbyname().
TIBRV-NETWORK-NOT-FOUND tibrvTransport_Create
using getnetbyname().
TIBRV-DAEMON-NOT-FOUND tibrvTransport_Create
number.
TIBRV-NO-MEMORY TIBRV-INVALID-SUBJECT TIBRV-DAEMON-NOT-CONNECTED
The function could not allocate dynamic storage. The function received a subject name with incorrect syntax. The TIBCO Rendezvous for z/OS daemon process (rvd) exited, or was never started. This status indicates that the program cannot start the daemon and connect to it. The library, header files and TIBCO Rendezvous for z/OS daemon are incompatible.
TIBRV-VERSION-MISMATCH
tibrv-status 327
(Sheet 2 of 4) Constant
TIBRV-SUBJECT-COLLISION
Description It is illegal to create two certified listener events with overlapping subjects. The program attempted an illegal operation. For example: Cannot create ledger file. Cannot confirm an uncertified message (that is, it has no sequence number).
TIBRV-NOT-PERMITTED
TIBRV-INVALID-NAME TIBRV-INVALID-TYPE
The field name is too long. 1. The field type is not registered. 2. Cannot update field to a type that differs from the existing fields type.
The explicit size in the field does not match its explicit type. The explicit field count does not match its explicit type. The function could not find the specified field in the message. Cannot add this field because its identifier is already present in the message; identifiers must be unique. After field search by identifier fails, search by name succeeds, but the actual identifier in the field is non-NULL (so it does not match the identifier supplied). The function found the specified field, but could not convert it to the desired datatype. The datatype handler number is reserved for TIBCO Rendezvous for z/OS internal datatype handlers. The programs datatype encoder failed. The programs datatype decoder failed. The function received a message argument that is not a well-formed message; for example, NULL.
TIBRV-ID-CONFLICT
TIBRV-CONVERSION-FAILED
TIBRV-RESERVED-HANDLER
328
| Chapter 13
Status
TIBRV-INVALID-FIELD TIBRV-INVALID-INSTANCE
The program supplied an invalid field as an argument. The program supplied zero as the field instance number (the first instance is number 1). The function detected a corrupt message argument. The most common cause is that the program corrupted storage by accessing the message in two threads simultaneously (without proper locking).
TIBRV-CORRUPT-MSG
TIBRV-TIMEOUT
A timed dispatch call returned without dispatching an event. A send request call returned without receiving a reply message.
TIBRV-INTR TIBRV-INVALID-DISPATCHABLE
Interrupted operation. The function received an event queue or queue group that has been destroyed, or is otherwise unusable. The function received a dispatcher that is invalid or has been destroyed. The function received an event that has been destroyed, or is otherwise unusable. The function received NULL instead of a callback function. The function received a queue that has been destroyed, or is otherwise unusable. The function received a queue group that has been destroyed, or is otherwise unusable. The function received a negative timer interval. The function received an invalid I/O source (for this operating system). The function received an invalid I/O condition (for this operating system).
TIBRV-INVALID-DISPATCHER
TIBRV-INVALID-EVENT
TIBRV-INVALID-CALLBACK TIBRV-INVALID-QUEUE
TIBRV-INVALID-QUEUE-GROUP
TIBRV-INVALID-TIME-INTERVAL TIBRV-INVALID-IO-SOURCE
TIBRV-INVALID-IO-CONDITION
tibrv-status 329
(Sheet 4 of 4) Constant
TIBRV-SOCKET-LIMIT
TIBRV-OS-ERROR TIBRV-INSUFFICIENT-BUFFER
The function received a buffer argument that is too small to contain the result. End of file. Ledger file is not recognizable as such. TIBCO Rendezvous for z/OS software could not find the specified file. The program cannot open the specified file because another program owns it. For example, ledger files are associated with correspondent names.
TIBRV-NOT-FILE-OWNER
TIBRV-IO-FAILED
330
| Chapter 13
Status
tibrvStatus_GetText
Function Declaration
CALL tibrvStatus_GetText USING BY VALUE TIBRV-STATUS RETURNING STATUS END-CALL RVBSTAT
Return the descriptive string corresponding to a status code. Status strings use the ISO 8859-1 character encoding. Parameter
STATUS
Description Return the pointer of the string for this status code. page 326
See Also
tibrv-status,
| 331
Appendix A
Custom Datatypes
TIBCO Rendezvous for z/OS programs can manipulate custom datatypes by defining and registering functions to translate them. This appendix describes the required functions and the tools you can use to implement them. For most programs, the standard set of datatypes is sufficient. If your program does not require custom datatypes, you may skip this appendix.
Topics
Operations by Functional Group, page 332 Operations in Alphabetical Order, page 333 Architecture Overview, page 334 Custom Datatype Checklist, page 337 Convenience Functions, page 338
332
| Appendix A
Custom Datatypes
Description
Page
Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes. Convert a message field to another local datatype. Decode a wire format field to a local datatype. Encode a local format field to wire format.
339
Storage Type
tibrvMsgDataType
341
Utility Functions
tibrvMsgData_ByteSize tibrvMsgData_CopyBytes
Calculate the wire buffer size of data from its C size. Copy data into the wire buffer of a message for an encoder. Get data pointer and size from a wire buffer for a decoder. Get the data size from a wire buffer for a decoder. Allocate process storage for decoders and converters. Write the size of data into a wire buffer for an encoder.
Description Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes. Provides status on types of low-level data references. Calculate the wire buffer size of data from its C size. Convert a message field to another local datatype. Copy data into the wire buffer of a message for an encoder. Decode a wire format field to a local datatype. Encode a local format field to wire format. Get data pointer and size from a wire buffer for a decoder. Get the data size from a wire buffer for a decoder. Allocate process storage for decoders and converters. Write the size of data into a wire buffer for an encoder.
Page 339
341 342 343 345 347 348 350 352 354 355
334
| Appendix A
Custom Datatypes
Architecture Overview
Table 2 explains the stratification of data, field and message operations into four layers. Table 2 Architecture of Message and Data Manipulation Layer 4. Convenience Functions Description Type-specific functions manipulate message field data. This layer contains three functions per datatypeadd, get and update. For example, see Add String on page 50. All convenience functions call the corresponding generic functions of layer 3 for their main functionality. When defining a custom datatype, a program can implement these three functions (optional). 3. Generic Field Functions Field functions add, get or update a message field. This layer consists of three only functions: tibrvMsg_AddField, tibrvMsg_GetField, tibrvMsg_UpdateField. Field functions call the datatype handler functions of layer 2 whenever data enters or leaves a message. Type-specific handler functions translate data between C format and TIBCO Rendezvous for z/OS wire format, and convert it to other datatypes. This layer contains three functions per datatype: encoder, of type tibrvMsgData_Encoder decoder, of type tibrvMsgData_Decoder converter, of type tibrvMsgData_Converter
To define a custom datatype, a program must implement these functions. 1. Utility Functions Utility functions ease and standardize the implementation of datatype handler functions in layer 2. For example, tibrvMsgData_CopyBytes.
At the top of the table, programs call functions in layer 4 (and sometimes layer 3) to move data in and out of messages. The remaining lower layers are generally invisible to most programs. That is, most programs do not call functions below layers 3.
TIBCO Rendezvous for z/OS COBOL Reference
However, a program that defines custom datatypes must implement the three functions in layer 2. Nevertheless, the program never calls layer 2 functions directly. Instead the program can define optional convenience functions at layer 4, and call them to move the custom datatype in and out of messages.
Adding Data
This narrative illustrates the interaction of functions at all four layers as they cooperate to add data to a message. The narrative for updating data within a message is parallel. A program begins by calling a layer 4 convenience function to add data. The convenience function creates a field object (tibrvMsgField) that contains the data, the field name and identifier, a datatype token, and the element count (for arrays only). Then the convenience function calls the layer 3 field function tibrvMsg_AddField to add that field to the message. Among its other tasks, tibrvMsg_AddField must write the field into wire buffer storage within the message object; to accomplish this step, it calls the layer 2 encoder function specific to the datatype. The encoder transforms the data into its wire format, using layer 1 utility functions to copy that data into the messages wire buffer. Each write operation updates the messages wire buffer pointer to the location where the next write will begin. Figure 10 Writing Fields into a Messages Wire Buffer
Field m Field m+1
name
type
size
data
name
type
size
data
Extracting Data
This narrative illustrates the interaction of functions at all four layers as they cooperate to get data from a message.
336
| Appendix A
Custom Datatypes
A program begins by calling a layer 4 convenience function to get data. The convenience function calls the layer 3 field function tibrvMsg_GetField to find the field in the message. Among its other tasks, tibrvMsg_GetField must read the data from the messages wire buffer; to accomplish this step, it calls the layer 2 decoder function for the datatype (as specified in the message field). The decoder uses layer 1 utility functions to extract that data from the messages wire buffer, and transforms the data into its C format. Returning to layer 3, tibrvMsg_GetField receives the data from the decoder, packaged in the DATA part of a field object (tibrvMsgField). Returning to layer 4, the convenience function receives the field object from The next task is to convert the data from its actual datatype to the target datatype (notice that the program, in effect, explicitly requested a target datatype by calling a particular type-specific convenience function). When the actual data does not already match the target datatype, the convenience function calls down into layer 2, to the converter function associated with the actual datatype.
tibrvMsg_GetField.
If legal, the converter transforms the actual data to the target type, and modifies the field object accordingly. Returning once again to layer 4, the convenience function extracts the modified data from the field object, and passes it back to the calling program.
338
| Appendix A
Custom Datatypes
Convenience Functions
When defining custom datatypes, programs have the option to also define convenience functions for the new type. In general, layer 4 convenience functions rely on layer 3 generic field functions to do most of their work, packing or unpacking the field structure as appropriate. You can choose to implement up to three convenience functions: Get a value of the custom datatype from a message. Add a value of the custom datatype to a message. Update an existing field in a message with a new value of the custom datatype.
Get
The get function must fulfill these responsibilities: Call tibrvMsg_GetField to find the field in the message. Check that tibrvMsg_GetField did not return an error code. Check that the TYPE of the field matches the target datatype of the convenience function. If the conversion is illegal, return an error code. If it matches, then return, passing back the DATA directly. Otherwise, convert the data to the target datatype. Pass back the converted DATA. (In most cases, converter functions associated with the actual datatype are unable to convert it to a custom type, so either the convenience function must convert it, or declare the conversion illegal.)
tibrvMsg_SetHandlers 339
tibrvMsg_SetHandlers
Function Declaration
CALL tibrvMsg_SetHandlers USING BY VALUE TYPE BY VALUE ENCODER BY VALUE DECODER BY VALUE CONVERTER RETURNING TIBRV-STATUS END-CALL RVBMSHND
Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes. Programs that define custom data handler functions must register them before any message operations involving the custom datatype. The programs data handler functions must properly address byte order and endian issues. Parameter
TYPE
Remarks
Description Use this number as a unique identifier for the new datatype. The type identifier must be in the range [TIBRVMSG-USER-FIRST, TIBRVMSG-USER-LAST]; all other identifiers are reserved.
ENCODER
This function translates a local format instance of the datatype into wire format. See tibrvMsgData_Encoder on page 348.
NULL indicates that the program cannot add or update fields of this datatype.
DECODER
This function translates wire format to a local format instance of the datatype. See tibrvMsgData_Decoder on page 347.
NULL indicates that the program cannot get fields of this datatype.
CONVERTER
This function translates a field of this datatype to other datatypes. See tibrvMsgData_Converter on page 343.
NULL indicates that the program cannot force conversion to another datatype during get and update calls.
340
| Appendix A
Custom Datatypes
See Also
tibrvMsgData_Converter, tibrvMsgData_Decoder,
tibrvMsgDataType 341
tibrvMsgDataType
Type Declaration
05 tibrvMsgDataType PIC 9(2) BINARY. 88 TIBRVMSGDATA-PRIMITIVE VALUE 88 TIBRVMSGDATA-MALLOCBLOCK VALUE 88 TIBRVMSGDATA-SUBMESSAGE VALUE 88 TIBRVMSGDATA-WIREREFERENCE VALUE
0. 1. 2. 3.
Purpose Remarks
Provides status on types of low-level data references. This status specifies the four low-level types of data reference that can be extracted from a message field. Decoders and converters create references to the data that they extract, and must inform the message of the type each time they create a reference. Internal functions use this type information to properly maintain references to the extracted data. Description Extract primitive types by copying the data into the destination field struct. Extract this type by allocating a block of storage associated with the message. The predefined set of malloc block types includes all arrays. On EBCDIC architectures, it also includes EBCDIC strings.
Value
TIBRVMSGDATA-PRIMITIVE
TIBRVMSGDATA-MALLOCBLOCK
TIBRVMSGDATA-SUBMESSAGE
Extract this type by creating a new tibrvMsg object for the decoded data. The only submessage type is tibrvMsg.
TIBRVMSGDATA-WIREREFERENCE
Extract this type by copying a pointer into the destination field struct; the pointer refers to a location within the wire buffer of the message. The predefined set of wire reference types includes character strings, opaque byte sequences, and XML data.
See Also
Wire Format Datatypes, page 320 tibrvMsgData_Converter, page 343 tibrvMsgData_Decoder, page 347 tibrvMsgData_Malloc, page 354
342
| Appendix A
Custom Datatypes
tibrvMsgData_ByteSize
Function Declaration
CALL tibrvMsgData_ByteSize USING BY VALUE CONTENT_SIZE RETURNING TIBRV-U32 END-CALL RVBDBYSZ
Calculate the wire buffer size of data from its C size. Encoders call this layer 1 function to preview the wire size of the data as tibrvMsgData_CopyBytes would write it into the message (that is, including extra bytes for size information). Encoders test this wire size against the available space in the message. Parameter
CONTENT-SIZE
Description The encoder supplies the C size (in bytes) of data. page 348 page 355
See Also
tibrvMsgData_Encoder, tibrvMsgData_SetSize,
tibrvMsgData_Converter 343
tibrvMsgData_Converter
Function Type Declaration
ENTRY BY BY BY tibrvMsgData_Converter USING REFERENCE FIELD VALUE DESTINATION-TYPE REFERENCE CONVERTER-TYPE.
Purpose Remarks
Convert a message field to another local datatype. Programs define converters for custom datatypes. Each converter function receives a message field, and replaces information within it. Each converter must fulfill these responsibilities: For disallowed conversions, return the status code TIBRV-CONVERSION-FAILED. Convert the fields DATA to the destination_type, and store the new DATA back into the field. Set the fields SIZE part to reflect the new size of the converted data. Set the fields COUNT part to reflect the new element count of the converted data. Set the fields TYPE part to reflect the destination_type. Store the low-level type of the new reference in *converted_type. Description This parameter receives the location of a message field. The converter function modifies that field to effect the conversion. This parameter receives the type identifier representing the datatype of the resulting field. This parameter instructs the converter function to convert the field to this datatype. The parameter can be any of the predefined datatypes listed in Wire Format Datatypes on page 320, as well as any custom datatypes that the program defines.
Parameter
FIELD
DESTINATION-TYPE
344
| Appendix A
Custom Datatypes
Parameter
CONVERTED-TYPE
Description This parameter receives a location. The converter function must store the low-level type of the new data reference in that location.
See Also
tibrvMsgField,
tibrvMsgData_CopyBytes 345
tibrvMsgData_CopyBytes
Function Declaration
CALL tibrvMsgData_CopyBytes USING BY REFERENCE BUFFER BY REFERENCE SRC BY VALUE SIZE RETURNING TIBRV-STATUS END-CALL RVBDCBYT
Copy data into the wire buffer of a message for an encoder. This layer 1 function does these steps (see Figure 11 on page 346): 1. Compute the wire size of the data from the size parameter. 2. Write the wire size into the wire buffer, and advance *buffer. (Now *buffer points to the end of the size information, which will be the start of the data.) 3. Copy size bytes from src into the wire buffer, and advance *buffer again. Now *buffer points to the end of the copied data. 4. Return. Parameter
BUFFER
Description The encoder supplies the location of an address within the wire buffer of a destination message. This function copies the source data into the destination message, starting at that address. Before returning, this function advances *buffer to the end of the data that it copied.
SRC SIZE
Copy the data from this source buffer. Number of bytes to copy.
346
| Appendix A
Custom Datatypes
Figure 11 tibrvMsgData_CopyBytes
Before
*buffer src size 7
F o
e s
After
*buffer src size 7
F o
e s
7 F o
See Also
tibrvMsgData_ByteSize, tibrvMsgData_Encoder,
e s
tibrvMsgData_Decoder 347
tibrvMsgData_Decoder
Function Type Declaration
ENTRY BY BY BY tibrvMsgData_Decoder USING REFERENCE WIRE-BUFFER REFERENCE FIELD REFERENCE DECODED-TYPE.
Purpose Remarks
Decode a wire format field to a local datatype. Programs define decoders for custom datatypes. Each decoder must fulfill these responsibilities: Set the SIZE, COUNT and DATA parts of the destination field struct. (The layer 3 function sets the NAME, ID and TYPE.) Advance *wire_buffer to the end the source data (in the message). tibrvMsgData_GetBytes automatically advances this buffer pointer. Store the low-level type of the new data reference in *decoded_type. Check consistency, and properly address byte order and endian issues. Description This parameter receives the location of an address within the wire buffer of the source message. The source data starts at that address. This parameter receives the location of a destination field object. The decoder function must set the parts of this field with the source data, its size and count. This parameter receives a location. The decoder function must store the low-level type of the new data reference in that location.
Parameter
WIRE-BUFFER
FIELD
DECODED-TYPE
See Also
tibrvMsgField,
348
| Appendix A
Custom Datatypes
tibrvMsgData_Encoder
Function Type Declaration
ENTRY BY BY BY tibrvMsgData_Encoder USING REFERENCE WIRE-BUFFER VALUE MEM-AVAILABLE REFERENCE FIELD.
Purpose Remarks
Encode a local format field to wire format. Programs define encoders for custom datatypes. Layer 2 encoder functions translate custom datatypes into TIBCO Rendezvous for z/OS wire format. Each encoder must fulfill these responsibilities: Check that the field contains valid data of the appropriate type. Check that the data will fit in the available space; if not, return the error status TIBRV-NO-MEMORY. The encoder can use tibrvMsgData_ByteSize to compute the wire size of the data. Write the data into wire buffer of the message. Do not overwrite space that is not available. Advance *wire_buffer to the end of the destination data (in the message). tibrvMsgData_CopyBytes automatically advances this buffer pointer. Check consistency, and properly address byte order and endian issues. Description This parameter receives the location of an address within the wire buffer of the destination message. The encoder must write the wire-format encoded data to this destination. We strongly recommend using tibrvMsgData_CopyBytes to transfer the data.
MEM-AVAILABLE
Parameter
WIRE-BUFFER
This parameter receives the size of the available storage in the messages wire buffer. This parameter receives a field object, with self-describing data in local format. This source field determines the data to place into the destination wire_buffer.
FIELD
tibrvMsgData_Encoder 349
Field m-1
Field m
Field m+1
name
type
size
data
After writing the name and type, layer 3 advances the wire buffer pointer to this location.
After writing the size and data, layer 2 must advance the wire buffer pointer to this location.
See Also
tibrvMsgField,
tibrvMsgData_ByteSize,
tibrvMsgData_CopyBytes,
350
| Appendix A
Custom Datatypes
tibrvMsgData_GetBytes
Function Declaration
CALL tibrvMsgData_GetBytes USING BY REFERENCE BUFFER BY REFERENCE SRC BY REFERENCE SIZE RETURNING TIBRV-STATUS END-CALL RVBDCGBYT
Get data pointer and size from a wire buffer for a decoder. This layer 1 function helps decoders extract data from a messages wire buffer. It does these steps (see Figure 13 on page 351): 1. Read the size information from the wire buffer (starting at the position *buffer) and store it in the size parameter. 2. Store the start position of the actual data in the src parameter. 3. Advance *buffer to point to the end of the actual data. 4. Return. After tibrvMsgData_GetBytes returns, the decoder can obtain the data by copying *size bytes from the location *src. Parameter
BUFFER
Description The decoder supplies the location of an address within the wire buffer of a source message. After reading the size information, this function advances *buffer to point to the location at the end of the data. The decoder supplies the location of a buffer pointer. This function stores the address of the actual data in that pointer. The decoder supplies a location. This function stores the size of the actual data in that location.
SRC
SIZE
tibrvMsgData_GetBytes 351
Figure 13 tibrvMsgData_GetBytes
Before
*buffer *src size
7 F o After
*buffer *src size 7
e s
7 F o
See Also
tibrvMsgData_Decoder,
e s
page 347
352
| Appendix A
Custom Datatypes
tibrvMsgData_GetSize
Function Declaration
CALL tibrvMsgData_GetSize USING BY REFERENCE BUFFER BY REFERENCE SIZE RETURNING TIBRV-STATUS END-CALL RVBDGSZ
Get the data size from a wire buffer for a decoder. This layer 1 function helps decoders extract data from a messages wire buffer. It does only part of the work that tibrvMsgData_GetBytes does (see Figure 14 on page 353): 1. Read the size information from the wire buffer (starting at the position *buffer) and store it in the size parameter. 2. Advance *buffer to point to the end of the size information, which is the start of the actual data. 3. Return. After tibrvMsgData_GetSize returns, the decoder can obtain the data by copying *size bytes from the location *buffer. We recommend using the more complete function tibrvMsgData_GetBytes; this function gives programmers finer control over pointer advancement (along with the responsibility to advance that pointer appropriately). Parameter
BUFFER
Description The decoder supplies the address of the wire buffer within the message. The function advances *buffer to point to the location at the end of the size (which is the beginning of the data). The decoder supplies a location. This function stores the size of the actual data in that location.
SIZE
tibrvMsgData_GetSize 353
Figure 14 tibrvMsgData_GetSize
Before
*buffer size
7 F o After
*buffer size 7
e s
7 F o
See Also
tibrvMsgData_Decoder,
e s
tibrvMsgData_GetBytes,
354
| Appendix A
Custom Datatypes
tibrvMsgData_Malloc
Function Declaration
CALL tibrvMsgData_Malloc USING BY VALUE SIZE RETURNING POINTER END-CALL RVBDMALC
Allocate process storage for decoders and converters. Decoders and converters must use this layer 1 function to allocate storage for extracted data. Do not use ordinary malloc. The function returns a pointer to the storage. The storage remains associated with the message, and persists until the message is destroyed. Programmers need not free this storage; instead, the message automatically frees the storage at the appropriate time. Decoders and converters that allocate storage using this function must pass back the type TIBRVMSGDATA-MALLOCBLOCK. Parameter
SIZE
See Also
tibrvMsgDataType,
tibrvMsgData_SetSize 355
tibrvMsgData_SetSize
Function Declaration
CALL tibrvMsgData_SetSize USING BY REFERENCE BUFFER BY VALUE SIZE RETURNING TIBRV-STATUS END-CALL RVBDSSZ
Write the size of data into a wire buffer for an encoder. This layer 1 function helps encoders write size information to a messages wire buffer. It does only part of the work that tibrvMsgData_CopyBytes does (see Figure 15 on page 356): 1. Write the size information into the wire buffer, starting at the position *buffer. 2. Advance *buffer to point to the end of the size information, which will become the start of the actual data. 3. Return. After tibrvMsgData_SetSize returns, the encoder can continue by writing the data starting at the (advanced) position *buffer. We recommend using the more complete function tibrvMsgData_CopyBytes to write the size and data with one call; when finer control is required, programmers can use this function instead, with corresponding responsibility. When using this function, the encoder must first use tibrvMsgData_ByteSize to measure the wire size from the data length. Parameter
BUFFER
Description The encoder supplies the address of a location within the messages wire buffer. This function writes the size into the destination message, and advances this buffer pointer. Size to copy into the wire buffer.
SIZE
356
| Appendix A
Custom Datatypes
Figure 15 tibrvMsgData_SetSize
Before
*buffer
After
*buffer
7
See Also
tibrvMsgData_ByteSize,
| 357
Index
A
action, fault tolerance 215 activate, fault tolerance 215 add event queue to a queue group 177 listener, certified delivery 267 message field 42 array 47 datetime 54 extended functions 43 nested message 49 opaque bytes 51 scalar 45 string 50 XML 52 advisory message, see TIBCO Rendezvous Concepts allow listener 269 array add 47 get 72 update 104
callback function 123 certified delivery 254 destroy complete event 124 fault tolerance 219
B
backward compatibility. See, release 5.
C
callback convenience function certified message 259 dispatch 174 listener 132
monitor 234 queue 157 fault tolerance 217 monitor 233 ledger review, certified delivery 291 certificate set daemon certificate 9 set user certificate 11, 12 certified delivery add listener 267 allow listener 269 confirm 256, 265 connect to relay agent 270 destroy listener 260 destroy transport 276 disallow listener 277 disconnect from relay agent 279 event 253 get ledger name 281 message time limit 302 name from transport 282 relay agent 283 request old 284 sender name from message 299 sequence number from message 300 sync ledger 285 transport 286 transport time limit 280 listener, create 257 remove listener 287 remove send state 289 review ledger 290 send 293
TIBCO Rendezvous for z/OS COBOL Reference
358
| Index
reply 294 request 295 set message time limit 303 transport time limit 297 sync ledger 298 transport 266 create 272 character encoding 32 checklist, programmers 2 clear references 55 close, environment 4 compatibility. See, release 5. complete time get 313 set 316 complete, destroy event 124 fault tolerance member 219 fault tolerance monitor 234 queue 157 confirm, certified delivery 256, 265 connect to relay agent 270 control, message storage 23 conversion, datatype 322 convert message to string 56 converter 343 copy message 58 correspondent, get name 282 count events in a queue 161 field, array items or string length 40 fields in a message 88 create certified delivery listener 257 dispatcher thread 188 distributed queue 308 fault tolerance member 221 fault tolerance monitor 236 I/O interest 127 inbox 198 listener 129 message 57 queue group 178 queue, event 158 timer 133 transport 195 certified delivery 272 with embedded license 197 custom datatypes 331 custom event manager hook 155 customer support xviii
D
daemon 201 data message field accessors 40 union type 33 validity of snapshot 24 datatypes 319 conversion 322 custom 331 register handlers 339 low-level reference 341 wire format 320 date 41 datetime, type definition 37 deactivate, fault tolerance 215 decoder 347 default event queue 154 delete field. See, remove. description 202, 209
Index 359
destroy certified delivery transport 276 completion callback function 124 dispatcher thread 190 even 136 event extended 137 fault tolerance member 225 fault tolerance monitor 238 message 60 queue 159 queue group 179 transport 200 detach message 61 disallow listener 277 discard events 163, 169 disconnect from relay agent, certified delivery 279 dispatch queue 160 queue group 180 dispatchable, type 186 dispatcher thread 187 create 188 destroy 190 distributed queue create 308 get complete time 313 get worker tasks 315 get worker weight 314 set complete time 316 set worker tasks 318 set worker weight 317
event callback function 123 certified delivery callback function 254 certified delivery, type 253 destroy 136 extended 137 destroy complete, callback function 124 discard 163, 169 dispatch 160 poll queue 166 queue 149 queue, get from event 145 certified delivery 264 timed dispatch 173 type 122 type token 147 get 144 event driver 5 event queue hook function get 162 remove 167 set 168 event queue, default 154 expand message, reallocate storage 62 extended functions add 43 get 68 update 101 extract. See get.
E
embedded license 197 encoder 348 encoding, character 32 error codes 326
360
| Index
F
fault tolerance action token 215 create member 221 create monitor 236 destroy member 225 destroy monitor 238 group name 227, 239 join 221 member callback function 217 member destroy complete callback 219 monitor callback function 233 monitor destroy complete callback 234 queue 228, 240 transport 229, 241 weight 230 set 231 withdraw 225 field add to message 42 array 47 datetime 54 nested message 49 opaque bytes 51 scalar 45 string 50 XML 52 get 66 array 72 datetime 83 nested message 75 opaque bytes 79 scalar 70 string 77 XML 81 get by index 85 get instance from message 86 names and identifiers 29 remove 93 remove instance 95 type definition 40 update in message 99 array 104 datetime 114
TIBCO Rendezvous for z/OS COBOL Reference
nested message 106 opaque bytes 110 scalar 102 string 108 XML 112 fields, number in a message 88 format message as string 56 free message storage 60
G
get byte size of message 65 certified delivery ledger name 281 name 282 relay agent 283 request old 284 sync ledger 285 transport 286 complete time of distributed queue 313 daemon from transport 201 description from transport 202 dispatcher thread name 191 event queue hook function 162 extended functions 68 I/O source from event 139 I/O type from event 140 interval from timer 143 message field 66 array 72 datetime 83 nested message 75 opaque bytes 79 scalar 70 string 77 XML 81 message field by index 85 message field instance 86 network from transport 203 queue from event 145
Index 361
certified delivery 264 queue from fault tolerance member 228 queue from fault tolerance monitor 240 reply subject 89 send subject 90 service from transport 204 subject from listener 141 transport from fault tolerance member 229 transport from fault tolerance monitor 241 transport from listener 142 certified delivery 262, 263 type of event 144 weight from fault tolerance member 230 get group name fault tolerance member 227 fault tolerance monitor 239 group of event queues 176
J
join, create fault tolerance member 221
L
Latin-1 32 ledger file, rvcm_Enable() parameter 274 name, get from certified delivery transport 281 review 290 licensed transport 197 limit, queue 163, 169 listener create 129 certified delivery 257 destroy certified delivery 260 subject, get 141 transport, get 142 certified delivery 262, 263 listener, distributed queue. See, worker. local data 33 loop, get field by index lost interval 237
H
handlers, set custom datatype 339 hook, event queue 155
I
I/O create event interest 127 source, get 139 type 148 type, get 140 id, field identifier 29, 40 inbox, create 198 instance, get field 86 interval get from timer 143 reset timer 146 intra-process transport 194
M
malloc message storage for custom datatype 354 mark references 91 maximum events, queue 163, 169 member, fault tolerance 216 callback function 217 create 221 destroy 225 group name 227 queue 228 transport 229 weight 230 set 231
362
| Index
message add field 42 array 47 datetime 54 nested message 49 opaque bytes 51 scalar 45 string 50 XML 52 copy 58 create 57 create from data bytes 59 destroy 60 detach 61 expand 62 format as string 56 get data as a byte sequence 64 get data as a byte string 63 get field 66 array 72 datetime 83 nested message 75 opaque bytes 79 scalar 70 string 77 XML 81 get field by index 85 get field instance 86 ownership and control 23 references clear 55 mark 91 remove field 93 remove field instance 95 reply subject get 89 set 97 reset 96 send subject set 98 send subject, get 90 size 65 type definition 36 update field 99 array 104
TIBCO Rendezvous for z/OS COBOL Reference
datetime 114 nested message 106 opaque bytes 110 scalar 102 string 108 XML 112 message field, type definition 40 monitor, fault tolerance 232 callback 233 create 236 destroy 238 group name 239 queue 240 transport 241
N
name certified delivery, get sender from message 299 dispatcher thread 191, 192 get from certified delivery transport 282 of a certified delivery transport 274 of a queue 164, 171 name, of a field 40 nested message, add field to message 49 network 203 new. See, create. number of fields in a message 88
O
open, environment 5 overflow, queue 156, 163, 169 ownership, message storage 23
P
PEM 11 PKCS #12 12
Index 363
policy queue limit 156, 163, 169 poll queue 166 queue group 181 prepare-to-activate, fault tolerance 215 priority, queue 165, 172 process transport 194 programming environment 2
R
raw storage device, as ledger file 274 reallocate 62 references clear 55 mark 91 register custom datatype 339 relay agent connect to 270 disconnect from 279 get from certified delivery transport 283 release 5, interaction CM sequence numbers several fields with same name remove event queue from a queue group 182 event queue hook function 167 field from message 93 field instance from message 95 listener, certified delivery 287 send state, certified delivery 289 reply subject get 89 set 97 reply, send 206 certified delivery 294 request old messages, get from certified delivery transport 284 request, send 207 certified delivery 295 reset message 96 timer interval 146 return codes 326 review ledger 290 callback function 291
Q
queue count 161 create 158 destroy 159 destroy complete, callback function 157 discard 163, 169 dispatch 160 fault tolerance member 228 fault tolerance monitor 240 get from event 145 certified delivery 264 hook 155 limit policy 156, 163, 169 maximum events 163, 169 name 164, 171 poll 166 priority 165, 172 timed dispatch 173 type 154 queue group add 177 create 178 destroy 179 dispatch 180 poll 181 remove 182 timed dispatch 183 type 176 queue, default 154
364
| Index
S
scalar add 45 get 70 update 102 secure daemon set daemon certificate 9 set user certificate 11, 12 set user name 14 send 205 certified delivery 293 reply 294 request 295 reply 206 request 207 send subject get 90 set 98 sequence number, certified delivery 300 service, get from transport 204 set complete time of distributed queue 316 description of transport 209 dispatcher thread name 192 event queue hook function 168 reply subject 97 secure daemon certificate 9 send subject 98 timer interval 146 user certificate 11, 12 user name with password 14 weight of fault tolerance member 231 size field 40 message 65 snapshot, data 24 source, get from I/O event 139 start 5 status codes 326 string encoding 32 string, format message as 56 subject get from listener 141 maximum length of name 97, 98 reply get 89 set 97 send get 90 set 98 support, contacting xviii sync ledger certified delivery 298 get from certified delivery transport 285
T
task capacity get 315 set 318 technical support xviii thread, create dispatcher 188 tibrv_Close 4 tibrv_CurrentDate, obsolete, see tibrvMsg_GetCurrentTime 41 TIBRV_DEFAULT_QUEUE 154 tibrv_Open 5 tibrv_Version 8, 215 tibrvcm_Version 252 tibrvcmEvent (type) 253 tibrvcmEvent_ConfirmMsg 256 tibrvcmEvent_CreateListener 257 tibrvcmEvent_CreateListener_Cobol 259 tibrvcmEvent_Destroy 260 tibrvcmEvent_GetListenerTransport 262, 263 tibrvcmEvent_GetQueue 264 tibrvcmEvent_SetExplicitConfirm 265 tibrvcmEventCallback (type) 254 tibrvcmReviewCallback 291 tibrvcmTransport (type) 266 tibrvcmTransport_AddListener 267 tibrvcmTransport_AllowListener 269 tibrvcmTransport_ConnectToRelayAgent 270 tibrvcmTransport_Create 272
Index 365
tibrvcmTransport_CreateDistributedQueue 308 tibrvcmTransport_Destroy 276 tibrvcmTransport_DisallowListener 277 tibrvcmTransport_DisconnectFromRelayAgent 279 tibrvcmTransport_GetCompleteTime 313 tibrvcmTransport_GetDefaultCMTimeLimit 280 tibrvcmTransport_GetLedgerName 281 tibrvcmTransport_GetName 282 tibrvcmTransport_GetRelayAgent 283 tibrvcmTransport_GetRequestOld 284 tibrvcmTransport_GetSyncLedger 285 tibrvcmTransport_GetTransport 286 tibrvcmTransport_GetWorkerWeight 314 tibrvcmTransport_RemoveListener 287 tibrvcmTransport_RemoveSendState 289 tibrvcmTransport_ReviewLedger 290 tibrvcmTransport_Send 293 tibrvcmTransport_SendReply 294 tibrvcmTransport_SendRequest 295 tibrvcmTransport_SetCompleteTime 316 tibrvcmTransport_SetDefaultCMTimeLimit 297 tibrvcmTransport_SetWorkerTasks 318 tibrvcmTransport_SetWorkerWeight 317 tibrvcmTransport_SyncLedger 298 tibrvcmTransportGetWorkerTasks 315 tibrvDispatchable (type) 186 tibrvDispatcher (type) 187 tibrvDispatcher_Create 188 tibrvDispatcher_Destroy 190 tibrvDispatcher_GetName 191 tibrvDispatcher_SetName 192 TIBRVEVENT (type) 122 tibrvEvent_CreateIO 127 tibrvEvent_CreateListener 129 tibrvEvent_CreateListener_Cobol 132 tibrvEvent_CreateTimer 133 tibrvEvent_Destroy 136 tibrvEvent_DestroyEx 137 tibrvEvent_GetIOSource 139 tibrvEvent_GetIOType 140 tibrvEvent_GetListenerSubject 141 tibrvEvent_GetListenerTransport 142 tibrvEvent_GetQueue 145 tibrvEvent_GetTimerInterval 143 tibrvEvent_GetType 144
tibrvEvent_ResetTimerInterval 146 tibrvEventCallback (type) 123 tibrvEventOnComplete (type) 124 tibrvEventType 147 tibrvft_Version 214 tibrvftAction 215 TIBRVFT-ACTIVATE 215 TIBRVFT-DEACTIVATE 215 TIBRVFTMEMBER (type) 216 tibrvftMember_Create 221 tibrvftMember_Destroy 225 tibrvftMember_GetGroupName 227 tibrvftMember_GetQueue 228 tibrvftMember_GetTransport 229 tibrvftMember_GetWeight 230 tibrvftMember_SetWeight 231 tibrvftMemberCallback 217 tibrvftMemberOnComplete (function type) 219 tibrvftMonitor_Create 236 tibrvftMonitor_Destroy 238 tibrvftMonitor_GetGroupName 239 tibrvftMonitor_GetQueue 240 tibrvftMonitor_GetTransport 241 tibrvftMonitorCallback 233 tibrvftMonitorOnComplete (function type) 234 tibrvIOType 148 tibrvLocalData, union type 33 TIBRVMONITOR (type) 232 tibrvMsg (type) 36 tibrvMsg_Add convenience functions array 47 datetime 54 nested message 49 opaque bytes 51 scalar 45 string 50 XML 52 tibrvMsg_AddField 42 tibrvMsg_ClearReferences 55 tibrvMsg_ConvertToString 56 tibrvMsg_Create 57 tibrvMsg_CreateCopy 58 tibrvMsg_CreateFromBytes() 59 tibrvMsg_Destroy 60 tibrvMsg_Detach 61
TIBCO Rendezvous for z/OS COBOL Reference
366
| Index
tibrvMsg_Expand 62 tibrvMsg_Get convenience functions array 72 datetime 83 nested message 75 opaque bytes 79 scalar 70 string 77 XML 81 tibrvMsg_GetAsBytes 63 tibrvMsg_GetAsBytesCopy 64 tibrvMsg_GetByIndex 85 tibrvMsg_GetByteSize 65 tibrvMsg_GetCMSender 299 tibrvMsg_GetCMSequence 300 tibrvMsg_GetCMTimeLimit 302 tibrvMsg_GetCurrentTime 41 tibrvMsg_GetCurrentTimeString 41 tibrvMsg_GetField 66 tibrvMsg_GetInstance 86 tibrvMsg_GetNumFields 88 tibrvMsg_GetReplySubject 89 tibrvMsg_GetSendSubject 90 tibrvMsg_MarkReferences 91 tibrvMsg_RemoveField 93 tibrvMsg_RemoveFieldInstance 95 tibrvMsg_Reset 96 tibrvMsg_SetCMTimeLimit 303 tibrvMsg_SetHandlers 339 tibrvMsg_SetReplySubject 97 tibrvMsg_SetSendSubject 98 tibrvMsg_Update convenience functions array 104 datetime 114 nested message 106 opaque bytes 110 scalar 102 string 108 XML 112 tibrvMsg_UpdateField 99 tibrvMsgData_ByteSize 342 tibrvMsgData_Converter 343 tibrvMsgData_CopyBytes 345 tibrvMsgData_Decoder 347 tibrvMsgData_Encoder 348
TIBCO Rendezvous for z/OS COBOL Reference
tibrvMsgData_GetBytes 350 tibrvMsgData_GetSize 352 tibrvMsgData_Malloc 354 tibrvMsgData_SetSize 355 tibrvMsgDataType 341 tibrvMsgDateTime (type) 37 tibrvMsgField (type) 40 tibrvQueue (type) 154 tibrvQueue_Create 158 tibrvQueue_Destroy 159 tibrvQueue_Dispatch 160 tibrvQueue_GetCount 161 tibrvQueue_GetHook 162 tibrvQueue_GetLimitPolicy 163 tibrvQueue_GetName 164 tibrvQueue_GetPriority 165 tibrvQueue_Poll 166 tibrvQueue_RemoveHook 167 tibrvQueue_SetHook 168 tibrvQueue_SetLimitPolicy 169 tibrvQueue_SetName 171 tibrvQueue_SetPriority 172 tibrvQueue_TimedDispatch 173 tibrvQueue_TimedDispatch_Cobol 174 tibrvQueueGroup_Add 177 tibrvQueueGroup_Create 178 tibrvQueueGroup_Destroy 179 tibrvQueueGroup_Dispatch 180 tibrvQueueGroup_Poll 181 tibrvQueueGroup_Remove 182 tibrvQueueGroup_TimedDispatch 183 tibrvQueueHook (function type) 155 tibrvQueueLimitPolicy 156 tibrvQueueOnComplete (type) 157 TIBRVRQUEUEGROUP (type) 176 tibrvSecureDaemon_SetDaemonCert 9 tibrvSecureDaemon_SetUserCertWithKey 11 tibrvSecureDaemon_SetUserCertWithKeyBin 12 tibrvSecureDaemon_SetUserNameWithPassword 14 TIBRV-STATUS (type) 326 tibrvStatus_GetText 330 TIBRVTRANSPORT (type) 194 tibrvTransport_Create 195 tibrvTransport_CreateInbox 198 tibrvTransport_CreateLicensed 197
Index 367
tibrvTransport_Destroy 200 tibrvTransport_GetDaemon 201 tibrvTransport_GetDescription 202 tibrvTransport_GetNetwork 203 tibrvTransport_GetService 204 tibrvTransport_Send 205 tibrvTransport_SendReply 206 tibrvTransport_SendRequest 207 tibrvTransport_SetDescription 209 TIBVFT_PREPARE_TO_ACTIVATE 215 ticket file 2 time 41 time limit, certified delivery 280, 297, 302, 303 timed dispatch queue 173 queue group 183 timer create 133 get interval 143 reset interval 146 transport 194 certified delivery 266 create 195 licensed 197 daemon, get 201 description, get 202 description, set 209 destroy 200 certified delivery 276 fault tolerance member 229 fault tolerance monitor 241 get from certified delivery transport 286 get from listener 142 certified delivery 262, 263 network, get 203 send 205 reply 206 request 207 service, get 204
type 319 datetime 37 get from event 144 get from I/O event 140 message 36 of a field 40 of events 147 of I/O conditions 148 wire format 320
U
update extended functions 101 message field 99 array 104 datetime 114 nested message 106 opaque bytes 110 scalar 102 string 108 XML 112 user datatypes 331 user name and password, set 14
V
validity, data 24 version 8, 214, 215, 252
W
weight fault tolerance member 230 set 231 wire format datatypes 320 withdraw, destroy fault tolerance member 225 worker task capacity of distributed queue 315, 318 worker weight of distributed queue 314, 317
TIBCO Rendezvous for z/OS COBOL Reference
368
| Index
X
XML add 52 get 81 update 112