TIB RV Com Reference
TIB RV Com Reference
TIB RV Com Reference
COM Reference
Software Release 8.4
February 2012
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 THE LICENSE FILE) 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.
TIBCO, The Power of Now, TIB, Information Bus, Rendezvous, TIBCO Rendezvous and Messaging Appliance
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 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 © 1997–2012 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Software Inc. Confidential Information
Contents iii
|
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii
Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
TIBCO Rendezvous Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi
Connecting with TIBCO Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
How to Join TIBCOmmunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
How to Access All TIBCO Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
How to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Chapter 1 Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Programming Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Object Safety in Scripting Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Events in Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Deletion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Destroy Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Callback Methods and Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Strings and Character Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Numeric Datatypes and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Date and Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Closure Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Chapter 4 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Message Ownership and Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Field Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Validity of Data Extracted from Message Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Snapshot Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Snapshot Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Multiple Subscription Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Field Names and Field Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Finding a Field Instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Release 5 Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
TibrvMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
TibrvMsg.add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
TibrvMsg.addField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .303
Figures
Tables
TibrvCmTransport.createDistributedQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
TibrvCmTransport.setWorkerTasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Preface
Topics
Manual Organization
The organization of this book mirrors the underlying object structure of the
Rendezvous COM component. Each chapter describes a group of closely related
objects and the methods that pertain to them.
Within each object, methods appear in alphabetical order.
Related Documentation
z/OS Only
z/OS Installation
Installation Concepts and Configuration
COBOL
Administration C Reference
Reference
C++ Reference
Configuration
COM Reference
Tools
Java Reference
RVDM JMX
MBean API
.NET Reference
Reference Pages
Typographical Conventions
Convention Use
TIBCO_HOME Many TIBCO products must be installed within the same home directory. This
directory is referenced in documentation as TIBCO_HOME. The value of
ENV_HOME
TIBCO_HOME depends on the operating system. For example, on Windows
TIBRV_HOME systems, the default value is C:\tibco.
Other TIBCO products are installed into an installation environment. Incompatible
products and multiple instances of the same product are installed into different
installation environments. An environment home directory is referenced in
documentation as ENV_HOME. The default value of ENV_HOME depends on the
operating system. For example, on Windows systems the default value is
C:\tibco.
code font Code font identifies commands, code examples, filenames, pathnames, and
output displayed in a command window. For example:
Use MyCommand to start the foo process.
Convention Use
italic font Italic font is used in the following ways:
• To indicate a document title. For example: See TIBCO FTL Concepts.
• To introduce new terms For example: A portal page may contain several
portlets. Portlets are mini-applications that run in a portal.
• To indicate a variable in a command or code syntax that you must replace.
For example: MyCommand PathName
Key Key name separated by a plus sign indicate keys pressed simultaneously. For
combinations example: Ctrl+C.
Key names separated by a comma and space indicate keys pressed one after the
other. For example: Esc, Ctrl+Q.
The note icon indicates information that is of special interest or importance, for
example, an additional action required only in certain circumstances.
The tip icon indicates an idea that could be useful, for example, a way to apply
the information provided in the current section to achieve a specific result.
The warning icon indicates the potential for a damaging situation, for example,
data loss or corruption if certain steps are taken or not taken.
Convention Use
[ ] An optional item in a command or code syntax.
For example:
MyCommand [optional_parameter] required_parameter
| A logical OR that separates multiple items of which only one may be chosen.
For example, you can select only one of the following parameters:
MyCommand para1 | param2 | param3
Convention Use
{ } A logical group of items in a command. Other syntax notations may appear
within each logical group.
For example, the following command requires two parameters, which can be
either the pair param1 and param2, or the pair param3 and param4.
MyCommand {param1 param2} | {param3 param4}
In the next example, the command requires two parameters. The first parameter
can be either param1 or param2 and the second can be either param3 or param4:
MyCommand {param1 | param2} {param3 | param4}
In the next example, the command can accept either two or three parameters.
The first parameter must be param1. You can optionally include param2 as the
second parameter. And the last parameter is either param3 or param4.
MyCommand param1 [param2] {param3 | param4}
Chapter 1 Concepts
Topics
General Description
The Rendezvous COM component is a set of COM automation objects that allow
a variety of programming language environments to access Rendezvous message
middleware. The Rendezvous COM component supports several qualities of
Rendezvous service—ordinary messages, fault tolerance, certified message
delivery, and distributed queues.
The range of programming environments includes Visual Basic, Delphi, Visual
C++, J++, Microsoft Office products, as well as scripts in Internet Explorer and
Active Server Pages.
The automation objects feature dual interfaces—a custom vtable interface (for
most programming languages, including Visual Basic) and a dispatch table
interface (for scripting environments).
TIBCO Rendezvous no longer adds new features to the Microsoft COM interface.
However, we continue to maintain a COM interface to support legacy
applications.
Programming Environments
This document is oriented toward programmers using the Visual Basic (VB)
programming environment. This book presents method names using VB dot
notation, and code fragments using VB syntax. It is also possible to use
Rendezvous COM in other environments that accept COM components.
The release contains example programs for several environments—such as VB,
Excel (VBA), VBScript, and JavaScript—however, the examples are not
exhaustive.
Constants
The Rendezvous component defines all constants using enumerators in the type
library. These constants are available in all programming environments.
To view these constants in VB, use the object browser.
Constants include message datatypes, queue limit policies, queue default priority,
fault tolerance actions, distributed queue constants, queue dispatch constants,
and error status codes.
Events in Excel
Excel drops events during certain operations (for example, while calculating a
spreadsheet or editing a sheet). This behavior can result in missed Rendezvous
messages and timer events.
Error Handling
See Error Overview on page 290.
Objects
This COM component implements Rendezvous objects in two layers. Each COM
object is an outer shell, with a corresponding internal implementation object.
Programs create the outer object using the techniques of the programming
environment, such as the New or CreateObject methods. Programs initialize the
internal implementation using the Create method of the object class.
Once an object’s internal structure is initialized, we say that the outer COM object
is valid.
Programs can delete the internal implementation (which stops its activity) by
using the Destroy method of an outer COM object. However, destroying the
object in this way affects only the inner structure (in this situation we say that the
remaining outer object is invalid). In contrast, VB programs delete an outer object
by severing all references to it; to sever a variable reference, either set the object
variable to Nothing, or exit the scope of the variable. (Other programming
languages use similar constructs.) As a side effect of deleting the outer object, the
inner object is also tacitly destroyed.
Creation
Object creation involves three steps—declare a variable, create the outer COM
object, create the inner structure. To illustrate, these examples create message
objects (the sequence is analogous for other objects).
To create an empty message object in a VB program, use this sequence:
Dim myMsg as TibrvMsg ’Declare the variable
set myMsg = new TibrvMsg ’Create the COM shell object
myMsg.create ’Init the internal message
structure
Deletion
VB program code can delete an object by severing all variable references to it.
Sever each variable reference in one of two ways:
• Explicit—set the variable to Nothing.
• Implicit—exit the scope of the variable.
Calling methods of a variable that is set to Nothing can yield error 91.
Destroy Method
The destroy method invalidates the internal implementation of an object. The
outer object remains as an empty shell.
A program may call the destroy method of an object more than once without
error.
Validity
The isValid method tests the validity of an object. If its internal implementation
is intact, then it is valid. (In contrast, checking that the value of a variable is not
Nothing merely tests that the variable refers to an outer object.)
Calling any other methods of an object that is invalid yields the error
TIBRVCOM_NOT_INITIALIZED. Conversely, calling the create method on a valid
object yields the error TIBRVCOM_ALREADY_INITIALIZED.
Limitations
In the single-threaded apartment model (STA), the Rendezvous component does
not trigger dispatch while a program callback method is already running. Visual
Basic is subject to this limitation.
This restriction does not apply in the multi-threaded apartment model (MTA).
When two programs exchange messages within the same locale, the automatic
translation between these two representations is correct. However, when a
message sender and receiver use different locales, the receiving program must
retranslate between code pages as needed.
Closure Data
Several object creation calls require a closure argument. These methods store the
closure data on the object, and pass it to the callback method.
The closure data is an Object.
Multi-Threading
Table 3 compares the two models for multi-thread behavior in COM. Rendezvous
7.0 (and later) supports both models. Rendezvous objects are thread-safe in either
model.
Restrictions
Programs using this model require Programs must not use a GUI in
the Windows message queue. threads that use this model.
Windows GUI programs
Such programs can not use the
automatically administer the
Rendezvous automatic dispatch
Windows message queue. Use this
queue group; instead, they must
model in the GUI thread.
explicitly dispatch Rendezvous events.
Such programs can use the
Rendezvous automatic dispatch
queue group.
Topics
• Checklist, page 14
• Referencing the Rendezvous COM Component, page 15
• Shared Library Files, page 16
Checklist
Developers of Rendezvous programs can use this checklist during the three
phases of the development cycle: installing Rendezvous software, coding your
program, and running your program.
Install
• Install the Rendezvous software release.
• Register (only one) Rendezvous component in the Windows registry, using
either these commands:
regsvr32 path\bin\tibrvcom.dll
regsvr32 path\bin\tibrvsdcom.dll
Code
• The project must set a reference to the Rendezvous component; see
Referencing the Rendezvous COM Component on page 15.
• Excel programs (and other applications that use VBA) must enable macros in
order to execute code using the Rendezvous component.
• The type library contains constant definitions that are available in all
programming environments. To view these constants in VB, use the object
browser. Select the appropriate constant library for your program (one
includes secure daemon features, the other does not).
Run
• rvd must be in one of the path directories.
• rvd requires valid licensing.
See Licensing Information on page 11 in TIBCO Rendezvous Administration.
VB
For example, in VB, select Project>References... In the resulting dialog box, check
either the item TibrvCOM or the item TibrvsdCOM—but not both simultaneously.
Visual Basic reads the type library to define all the objects, constants and
capabilities of the Rendezvous component.
Excel
For example, in Excel, select Tools>References... In the resulting dialog box,
check either the item TibrvCOM or the item TibrvsdCOM—but not both
simultaneously. Excel reads the type library to define all the objects, constants and
capabilities of the Rendezvous component.
This chapter describes the methods related to the internal machinery upon which
Rendezvous software depends.
Topics
• Tibrv, page 18
• TibrvSdContext, page 26
Tibrv
Class
Remarks Each program creates only one instance of Tibrv, and uses its methods to open
and close the Rendezvous environment, refer to Rendezvous resources, and
extract version information.
All other objects require an open Tibrv environment, and are inoperative when
the environment is not open. The only exceptions to this rule are the objects
defined in Chapter 4, Data, on page 33 (namely, TibrvMsg, TibrvMsgField, and
TibrvInt64).
Accessors
Tibrv.close
Method
Declaration Tibrv.close
After closing a Tibrv object, all events, transports, queues and queue groups
associated with that environment are invalid; all calls to any methods of these
objects will fail.
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.getAutoDispatchQueueGroup()
Method
Remarks This method returns a special queue group, which detects the presence of an
event in any of its queues, and automatically dispatches the queues (according to
their priority) until no more events are waiting.
To automatically dispatch a queue, add it to this queue group.
To disable automatic dispatch of queue, remove it from this group, and arrange
explicit dispatch calls instead. (It is crucial to dispatch all queues promptly—
otherwise queues can overflow or discard events. A queue without a discard limit
can cause the program to exceed available process storage.)
The automatic dispatch queue group is a convenience for programmers
developing GUI applications. GUI programs operate best with automatic event
dispatch. We do not recommend using explicit dispatch in GUI application
programs; see also Multi-Threading on page 11.
Each process can have at most one automatic dispatch queue group. A program
can use this queue group in at most one (STA) thread. Programs cannot destroy
this queue group.
If Rendezvous is not open, this method throws the error
TIBRVCOM_TIBRV_NOT_OPEN.
Parameter Description
autoDispatchGroup TibrvQueueGroup
Automatic dispatch continues until all the queues in this group are empty. During
that time, COM does not service GUI events.
VB GUI programs can ameliorate that difficulty by including DoEvents
statements in callback methods—but this solution requires attention to reentrance
issues.
Tibrv.getDefaultQueue()
Method
Each process has exactly one default queue. Tibrv.open automatically creates the
default queue. Programs cannot destroy the default queue.
Parameter Description
defaultQueue TibrvQueue
Tibrv.getProcessTransport()
Method
Remarks A program can use the intra-process transport to send messages to itself.
If Rendezvous is not open, this method reports the error
TIBRVCOM_TIBRV_NOT_OPEN, and returns a null object.
Parameter Description
processTransport TibrvTransport
Tibrv.getVersion()
Method
Remarks getVersion() returns the version numbers of the Rendezvous COM component
and the underlying C implementation of the core library.
getCmVersion() returns the version number of the underlying C implementation
of the certified delivery library.
getFtVersion() returns the version number of the underlying C implementation
of the fault tolerance library.
It is important that x.y represent a DLL at least as recent as the component a.b. If
not, you must reinstall a later version of Rendezvous software.
Parameter Description
version String
Return a string describing the software version numbers.
Tibrv.isOpen()
Method
Remarks This method returns True after the method Tibrv.open has returned
successfully.
Otherwise this method returns False. The value False usually indicates one of
these situations:
• The program has not opened the Rendezvous environment.
• Attempts to open the environment failed.
• The environment was open, but the program closed it with Tibrv.close.
Parameter Description
open Boolean
Return a state indicator.
Tibrv.open
Method
Declaration Tibrv.open
Remarks 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,
transports, queues and queue groups are unusable. Messages and their methods
do not depend on the internal machinery.
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.
TibrvSdContext
Class
Purpose This class defines static methods for interacting with secure Rendezvous
daemons.
Remarks Each program creates only one instance of TibrvSdContext, and uses its static
methods to configure user names, passwords and certificates, and to register trust
in daemon certificates.
Before using any methods of this class, ensure that your programming
environment reference the secure daemon TibrvsdCOM component; see Referencing
the Rendezvous COM Component on page 15.
Programs that use methods of this class must also use the type library
Secure Daemon TIBRVSDCOMLib (rather than TIBRVCOMLib) when defining
callback methods.
TibrvSdContext.setDaemonCert()
Method
Remarks When any program transport connects to a secure daemon, it verifies the
daemon’s identity using SSL protocols. Certificates registered using this method
identify trustworthy daemons. Programs divulge user names and passwords to
daemons that present registered certificates.
Parameter Description
daemonName String
daemonCert String
This string must be identical to the string you supply as the daemon argument to
the transport creation call; see TibrvTransport.create on page 166.
Colon characters (:) separate the three parts.
ssl indicates the protocol to use when attempting to connect to the daemon.
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.
(This syntax is similar to the syntax connecting to remote daemons, with the
addition of the prefix ssl.)
In place of this three-part string, you can also supply the null string
(vbNullString). 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 177 in TIBCO
Rendezvous Administration.
In place of an actual certificate, you can also supply the null string
(vbNullString). 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.
Any Name and Notice that supplying the null string (vbNullString) as either argument
Any Certificate eliminates one of the two security checks before transmitting sensitive
identification data to a secure daemon. We strongly discourage using the null
string for both parameters simultaneously, because that would eliminate all
security checks, leaving the program vulnerable to unauthorized daemons.
TibrvSdContext.setUserCertWithKey()
Method
Purpose Register a (PEM) certificate with private key for identification to secure daemons.
Remarks When any program transport connects to a secure daemon, the daemon verifies
the program’s identity using SSL protocols.
The Rendezvous API includes two methods that achieve similar effects:
• This call accepts a certificate in PEM text format.
• TibrvSdContext.setUserCertWithKeyBin() accepts a certificate in
PKCS #12 binary format.
Parameter Description
userCertWithKey String
password String
CA-Signed You can also supply a certificate signed by a certificate authority (CA). To use a
Certificate CA-signed certificate, you must supply not only the certificate and private key,
but also the CA’s public certificate (or a chain of such certificates). Concatenate
these items in one string. For important details, see CA-Signed Certificates on
page 177 in TIBCO Rendezvous Administration.
Exceptions An exception that reports status TIBRVCOM_INVALID_FILE can indicate either disk
I/O failure, or invalid certificate data, or an incorrect password.
TibrvSdContext.setUserCertWithKeyBin()
Method
Declaration TibrvSdContext.setUserCertWithKeyBin
userCertWithKey,
userCertWithKey_size,
password
Purpose Register a (PKCS #12) certificate with private key for identification to secure
daemons.
Remarks When any program transport connects to a secure daemon, the daemon verifies
the program’s identity using SSL protocols.
The Rendezvous API includes two methods that achieve similar effects:
• This call accepts a certificate in PKCS #12 binary format.
• TibrvSdContext.setUserCertWithKey() accepts a certificate in PEM text
format.
Parameter Description
userCertWithKey Object
Register this user certificate with private key. The binary data of this
certificate must be in PKCS #12 format.
userCertWithKey_size Long
password String
CA-Signed You can also supply a certificate signed by a certificate authority (CA). To use a
Certificate CA-signed certificate, you must supply not only the certificate and private key,
but also the CA’s public certificate (or a chain of such certificates). For important
details, see CA-Signed Certificates on page 177 in TIBCO Rendezvous
Administration.
TibrvSdContext.setUserNameWithPassword()
Method
Purpose Register a user name with password for identification to secure daemons.
Remarks When any program transport connects to a secure daemon, them daemon verifies
the program’s identity using SSL protocols.
Parameter Description
userName Register this user name for communicating with secure
daemons.
Chapter 4 Data
Topics
See Also
Strings and Character Encodings, page 7
Rendezvous software controls the storage in which all messages reside. Programs
can change the contents of a message only by using Rendezvous methods that
add, remove or update fields.
See Also
TibrvMsg.destroy on page 53
TibrvMsg.detach on page 54
Field Objects
When a program must extract information about a message field—such as its field
name, field identifier, or datatype—it can extract the field as a TibrvMsgField
object. A TibrvMsgField object contains complete detail about the field.
The methods TibrvMsg.getField(), TibrvMsg.getFieldByIndex(), and
TibrvMsg.getFieldInstance() return TibrvMsgField objects.
All TibrvMsgField objects always belongs to your program, so the program is
always responsible for deleting the field object.
Reference Datatypes
Five datatypes are called reference datatypes: array, message, opaque, XML, and
string.
When a message field contains a reference datatype, and a program extracts it as a
field object, then the data in the field object depends on a reference to a snapshot
in the parent message. For details, see Snapshot Reference on page 36.
See Also
Validity of Data Extracted from Message Fields, page 36
TibrvMsgField on page 93
TibrvMsg.getField() on page 63
To extract data values from the fields of a message, programs use the get methods.
All of these methods extract a snapshot of the message data—that is, the data value
as it exists at a particular time. If the program later modifies the message by
removing or updating the field, the snapshot remains unchanged.
Rendezvous messages implement snapshot semantics using two separate
strategies—snapshot copy and snapshot reference.
Snapshot Copy
A snapshot copy is independent of the original message. The program can modify
this snapshot at any time without affecting the original message. The program can
update or delete the original field form the message at any time without affecting
the snapshot copy.
These methods always return an independent snapshot copy of the data:
• TibrvMsg.get()
• TibrvMsg.getByIndex()
• TibrvMsg.getInstance()
• TibrvMsgField.getData()
Snapshot Reference
A snapshot reference is a reference to data that still resides within the original
message. The validity of the reference depends on the continued validity of the
original message.
These are the only methods that can produce a snapshot reference; moreover,
these methods only produce a snapshot reference when the datatype of the field is
array, message, opaque, XML, or string:
• TibrvMsg.getField()
When a field object contains a reference datatype (array, message, opaque, XML,
or string), the data in the field object depends on a reference into the parent
message. If the parent message is deleted, the program can no longer extract these
datatypes from the field object; attempting to extract them references freed
storage, which is illegal, and can cause serious consequences.
• TibrvMsg.clearReferences
When a program repeatedly extracts snapshot references data and does not
destroy the parent messages, consider using these methods to control the
proliferation of references.
Message methods specify fields using a combination of a field name and a unique
field identifier. When absent, the default field identifier is zero.
To compare the speed and space characteristics of these two options, see Search
Characteristics on page 38.
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 ASCII 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.
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 one-dimensional array datatypes within message fields. The
method TibrvMsg.getInstance() 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.
TibrvMsg
Class
(Sheet 1 of 3)
Fields
(Sheet 2 of 3)
Archive
Accessors
String
(Sheet 3 of 3)
Encoding
Datatype The type library defines these constants, which denote wire format datatypes.
Constants
Table 5 Datatype Constants (Sheet 1 of 2)
Constant Comments
TIBRVCOM_MSG_NO_TAG
TIBRVCOM_MSG_MSG
TIBRVCOM_MSG_DATETIME
TIBRVCOM_MSG_OPAQUE
TIBRVCOM_MSG_STRING
TIBRVCOM_MSG_BOOL
TIBRVCOM_MSG_I8
Constant Comments
TIBRVCOM_MSG_U8
TIBRVCOM_MSG_I16
TIBRVCOM_MSG_U16
TIBRVCOM_MSG_I32
TIBRVCOM_MSG_U32
TIBRVCOM_MSG_I64
TIBRVCOM_MSG_U64
TIBRVCOM_MSG_F32
TIBRVCOM_MSG_F64
TIBRVCOM_MSG_IPPORT16
TIBRVCOM_MSG_IPADDR32
TIBRVCOM_MSG_I8ARRAY
TIBRVCOM_MSG_U8ARRAY
TIBRVCOM_MSG_I16ARRAY
TIBRVCOM_MSG_U16ARRAY
TIBRVCOM_MSG_I32ARRAY
TIBRVCOM_MSG_U32ARRAY
TIBRVCOM_MSG_I64ARRAY
TIBRVCOM_MSG_U64ARRAY
TIBRVCOM_MSG_F32ARRAY
TIBRVCOM_MSG_F64ARRAY
TIBRVCOM_MSG_USER_FIRST
TIBRVCOM_MSG_USER_LAST
TibrvMsg.add
Method
Remarks This method copies the information into the new message field. Subsequent
changes to the arguments do not affect the field in the message object.
Parameter Description
fieldName String
data Object
Encoding and This method automatically converts VB data to its corresponding Rendezvous
Type wire format type. Figure 1 on page 47 specifies default encodings with filled
Conversion circles; you can override the default encoding by supplying an explicit tibrvType
argument (numeric and supported conversions). This feature lets you add fields
with datatypes that the programming language does not directly support (for
example, a signed byte or an unsigned integer.
When adding a numeric value as a TIBRVMSG_BOOL, zero maps to False, and all
non-zero values map to True.
When adding a boolean value as a numeric scalar type, False maps to zero, and
True maps to 1.
When adding an unsigned value as a signed type, this method interprets the high
bit as a sign bit. When adding a numeric value as a type with lesser precision, this
method discards bits of precision without warning. When adding a numeric value
as a type with smaller range, this method checks the range and reports an error if
the target type cannot accommodate the value.
Encoding XML As a convenience, Visual Basic lets you add a string value as an XML field; the
resulting XML is encoded as UTF-16LE (16-bit Unicode, little-endian byte order).
However, other language APIs might not support this encoding. For this reason,
we discourage programmers from directly adding string values as XML fields.
Instead, we recommend converting the XML document string to a byte sequence,
using the encoding that corresponds to your locale. This practice ensures that all
receivers can easily parse the resulting XML document. For more information, see
Decoding XML on page 57.
Nested Message When the data argument is a message object, this method adds only the data
portion of the nested message; it does not include any address information or
certified delivery information.
Field Name The the longest possible field name is 127 bytes.
Length
Add
TibrvMsgInt64()
TibrvInt64
TibrvMsg
Double()
Integer()
Boolean
Single()
Double
Integer
Long()
Single
Byte()
String
Long
Date
Byte
TIBRVCOM_MSG_BOOL S S S S S P
TIBRVCOM_MSG_F32 S N S S N P
TIBRVCOM_MSG_F64 S S S S N P
TIBRVCOM_MSG_I8 S N N + N N P
TIBRVCOM_MSG_I16 S N N S S P
TIBRVCOM_MSG_I32 S N N S S P
TIBRVCOM_MSG_I64 S N N S S S P
TIBRVCOM_MSG_U8 S N N N N P
TIBRVCOM_MSG_U16 S N N S + N P
TibrvMsg Destination Type
TIBRVCOM_MSG_U32 S N N S S + P
TIBRVCOM_MSG_U64 S N N S S S + P
TIBRVCOM_MSG_IPADDR32 N N S S S P
TIBRVCOM_MSG_IPPORT16 N N S S N P
TIBRVCOM_MSG_DATETIME
TIBRVCOM_MSG_F32ARRAY
TIBRVCOM_MSG_F64ARRAY
TIBRVCOM_MSG_I8ARRAY +
TIBRVCOM_MSG_I16ARRAY
TIBRVCOM_MSG_I32ARRAY
TIBRVCOM_MSG_I64ARRAY
TIBRVCOM_MSG_U8ARRAY S
TIBRVCOM_MSG_U16ARRAY +
TIBRVCOM_MSG_U32ARRAY +
TIBRVCOM_MSG_U64ARRAY +
TIBRVCOM_MSG_MSG
TIBRVCOM_MSG_OPAQUE S
TIBRVCOM_MSG_STRING
TIBRVCOM_MSG_XML S S
Key
Homologous types; conversion always supported; no loss of information
S Supported conversion; always supported
N Numeric conversion; out of range is an error; loss of sign or precision is OK
+ Signed interpreted as unsigned integer, or unsigned interpreted as signed
P Parsed conversion; supported when string has appropriate format
Unsupported conversion
TibrvMsg.addField
Method
Remarks This method copies the information into a new message field, without type
conversion.
It is illegal to add a field that has both a null field name (vbNullString), and a
non-zero field identifier.
Parameter Description
field TibrvMsgField
TibrvMsg.clearReferences
Method
Declaration TibrvMsg.clearReferences
Remarks This method clears references back to the most recent mark.
For a description and example, see TibrvMsg.markReferences on page 77.
TibrvMsg.create
Method
Remarks This method initializes the internal structure of the message object, allocating
storage for it.
Calling this method on a valid object yields the error
TIBRVCOM_ALREADY_INITIALIZED.
Parameter Description
initialSize Long; optional
Allocate a message of this non-negative size (in bytes).
(Messages can grow dynamically.)
When absent or zero, Rendezvous allocates initial storage
automatically. We recommend omitting this argument.
TibrvMsg.createCopy()
Method
Remarks Create an independent copy of the message, copying all its fields (that is, field
values are also independent copies).
This method does not copy subject information, certified delivery information,
nor other supplementary information or properties.
This method does not copy snapshot references into the new copy message.
Parameter Description
msgCopy TibrvMsg
TibrvMsg.createFromByteArray
Method
Parameter Description
byteArray Object
TibrvMsg.destroy
Method
Declaration TibrvMsg.destroy
Remarks This method destroys only the internal structure of the message object.
Rendezvous software automatically destroys a message when program execution
leaves the scope of the object, or deletes all references to the object.
TibrvMsg.detach
Method
Declaration TibrvMsg.detach
Purpose Detach an inbound message from Rendezvous storage; the program assumes
responsibility for destroying the message.
Remarks 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
method; Rendezvous software destroys such messages when the callback method
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.
Example In this example, msgref is accessible after the callback method returns.
Dim msgref as TibrvMsg
TibrvMsg.get()
Method
Remarks Programs specify the field to retrieve using the fieldName and fieldId
parameters.
This method returns an independent snapshot copy of the field value. For details,
see Snapshot Copy on page 36.
Programs can use a related method to loop through all the fields of a message; to
retrieve each field of a message, see TibrvMsg.getByIndex() on page 60.
Parameter Description
fieldName String
data Object
1. If the program supplied zero as the identifier, or omitted any identifier, then
begin at 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 zero, return the
field.
If the name search succeeds, but the actual identifier in the field is non-zero
(so it does not match the identifier supplied) then report the error
TIBRVCOM_ID_CONFLICT.
If a message contains several fields with the same name, searching by name finds
the first instance of the field with that name.
When an error occurs, the method returns an empty object.
Extracting Earlier releases of Rendezvous software allowed programs to get fields from a
Fields from a nested submessage by concatenating field names. Starting with release 6,
Nested Message Rendezvous software no longer supports this special case convenience. Instead,
programs must separately extract the nested submessage using TibrvMsg.get()
(or a related method), and then get the desired fields from the submessage.
Decoding and This method automatically decodes the extracted field data from its Rendezvous
Type wire format type to a corresponding VB type. In Figure 2 on page 58, filled circles
Conversion (as well as + and - symbols) specify default decodings between homologous
types; you can override the default decoding by supplying an explicit tibrvType
argument (numeric and supported conversions).
Decoding XML As a convenience, Visual Basic lets you extract an XML field as a string value;
however, the resulting string is only valid if the XML field uses UTF-16LE
encoding. Other language APIs might not support this encoding. For this reason,
we discourage programmers from directly extracting an XML field as a string
value. Instead, we recommend extracting the XML document as a byte array, and
then explicitly converting it to a string using the encoding that corresponds to
your locale. For more information, see Encoding XML on page 46.
TibrvInt64()
TibrvInt64
TibrvMsg
Double()
Integer()
Boolean
Single()
Double
Integer
Long()
Single
Byte()
String
Long
Date
Byte
TIBRVCOM_MSG_BOOL S S S S S S
TIBRVCOM_MSG_F32 S S N N N S
TIBRVCOM_MSG_F64 S N N N N S
TIBRVCOM_MSG_I8 S N N + S S
TIBRVCOM_MSG_I16 S N N N N S
TIBRVCOM_MSG_I32 S N N N N S
TIBRVCOM_MSG_I64 S
TIBRVCOM_MSG_U8 S N N S S S
TIBRVCOM_MSG_U16 S N N N + S
TIBRVCOM_MSG_U32 S N N N N + S
tibrvMsg Source Type
TIBRVCOM_MSG_U64 S
TIBRVCOM_MSG_IPADDR32 S
TIBRVCOM_MSG_IPPORT16 S S
TIBRVCOM_MSG_DATETIME S
TIBRVCOM_MSG_F32ARRAY S
TIBRVCOM_MSG_F64ARRAY S
TIBRVCOM_MSG_I8ARRAY + S
TIBRVCOM_MSG_I16ARRAY S
TIBRVCOM_MSG_I32ARRAY S
TIBRVCOM_MSG_I64ARRAY S
TIBRVCOM_MSG_U8ARRAY S
TIBRVCOM_MSG_U16ARRAY + S
TIBRVCOM_MSG_U32ARRAY + S
TIBRVCOM_MSG_U64ARRAY S
TIBRVCOM_MSG_MSG S
TIBRVCOM_MSG_OPAQUE C
TIBRVCOM_MSG_STRING
TIBRVCOM_MSG_XML C
Key
Homologous types; conversion always supported
S Supported conversion; always supported
N Numeric conversion; loss of sign or precision OK; out of range truncated (no error)
+ Signed interpreted as unsigned integer, or unsigned interpreted as signed
+ Homologous types; conversion always supported, but sign bit interpretation as with +
C Caution; supported, but results sometimes can be misleading
Unsupported conversion
TibrvMsg.getAsByteArray()
Method
Remarks Return a copy of the data as a byte sequence, suitable for archiving in a file. To
reconstruct the message from bytes, see TibrvMsg.createFromByteArray on
page 52.
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 zero bytes.
Parameter Description
byteArray Object
TibrvMsg.getByIndex()
Method
Remarks Programs can loop through all the fields of a message, to retrieve each field in
turn using an integer index.
This method returns an independent snapshot copy of the field value. For details,
see Snapshot Copy on page 36.
These two related methods differ only in the form of their return values. The first
returns the field’s data value; the second returns a TibrvMsgField object.
Add, remove and update calls can perturb the order of fields (which, in turn, affects
the order when a program gets fields by index).
Parameter Description
index Long
Get the field with this index. Zero specifies the first field.
data Object
TibrvMsg.getByteSize()
Method
Remarks This method returns the size of the message. Programs can use this size in
conjunction with TibrvMsg.getAsByteArray(); for example, when writing the
message byte array to a file, and reading it in again (using binary file I/O).
Parameter Description
byteSize Long
TibrvMsg.getDefaultInboundEncoding()
Method
Parameter Description
encoding String
TibrvMsg.getField()
Method
Remarks When a program must extract information about a message field—such as its field
name, field identifier, or datatype—it can extract the field as a TibrvMsgField
object. A TibrvMsgField object contains complete detail about the field.
All TibrvMsgField objects always belongs to your program, so the program is
always responsible for deleting the field object.
Programs specify the field to retrieve using the fieldName and fieldId
parameters. The method returns a TibrvMsgField object. Unlike
TibrvMsg.get(), this method does not attempt any datatype conversions.
Programs can use a related method to loop through all the fields of a message; to
retrieve each field by its integer index number, see TibrvMsg.getFieldByIndex()
on page 65.
Parameter Description
fieldName String
field TibrvMsgField
TibrvMsg.getFieldByIndex()
Method
Remarks Programs can loop through all the fields of a message, to retrieve each field in
turn using an integer index.
When a program must extract information about a message field—such as its field
name, field identifier, or datatype—it can extract the field as a TibrvMsgField
object. A TibrvMsgField object contains complete detail about the field.
All TibrvMsgField objects always belongs to your program, so the program is
always responsible for deleting the field object.
Add, remove and update calls can perturb the order of fields (which, in turn, affects
the order when a program gets fields by index).
Parameter Description
index Long
Get the field with this index. Zero specifies the first field.
field TibrvMsgField
When a field object contains a reference datatype (array, message, opaque, XML,
or string), the data in the field object depends on a reference into the parent
message. If the parent message is deleted, the program can no longer extract these
datatypes from the field object; attempting to extract them references freed
storage, which is illegal, and can cause serious consequences.
TibrvMsg.getFieldInstance()
Method
Remarks 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 method in a loop that examines every field with a specified
name.
The first instance of the named field is instance 1.
When a program must extract information about a message field—such as its field
name, field identifier, or datatype—it can extract the field as a TibrvMsgField
object. A TibrvMsgField object contains complete detail about the field.
All TibrvMsgField objects always belongs to your program, so the program is
always responsible for deleting the field object.
When the instance argument is greater than the actual number of instances of
the field in the message, this method reports the error TIBRVCOM_NOT_FOUND.
Release 5 Rendezvous 5 (and earlier) did not support array datatypes. Some older
Interaction 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 one-dimensional array datatypes within message fields. The
method TibrvMsg.getInstance() 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.
(Sheet 1 of 2)
Parameter Description
fieldName String
instance Long
(Sheet 2 of 2)
Parameter Description
field TibrvMsgField
When a field object contains a reference datatype (array, message, opaque, XML,
or string), the data in the field object depends on a reference into the parent
message. If the parent message is deleted, the program can no longer extract these
datatypes from the field object; attempting to extract them references freed
storage, which is illegal, and can cause serious consequences.
TibrvMsg.getInstance()
Method
Remarks 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 method in a loop that examines every field with a specified
name.
The first instance of the named field is instance 1.
This method returns an independent snapshot copy of the field value. For details,
see Snapshot Copy on page 36.
When the instance argument is greater than the actual number of instances of
the field in the message, this method reports the error TIBRVCOM_NOT_FOUND.
Release 5 Rendezvous 5 (and earlier) did not support array datatypes. Some older
Interaction 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 one-dimensional array datatypes within message fields. The
method TibrvMsg.getInstance() 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.
Parameter Description
fieldName String
instance Long
data Object
TibrvMsg.getMsgEncoding()
Method
Remarks This call yields either the actual encoding stored with a message, or (if none is
stored) a reasonable estimate:
• When a message is created locally, and its send subject is set, then its encoding
is also set, and this call gets the actual encoding from the message. (This value
is identical to the program’s global outbound encoding.)
• When the message is created locally and its send subject is not set, then its
encoding is also not set, and this call gets the program’s global outbound
encoding. If no global value is set, this call yields the string UNKNOWN.
• If the message is inbound, and bears an explicit encoding, then this call gets
that encoding.
• If the message is inbound, and does not bear an explicit encoding, then this
call gets the program’s global default inbound encoding. If no global default is
set, this call yields the string UNKNOWN.
Parameter Description
encoding String
TibrvMsg.getNumFields()
Method
Remarks This method counts the immediate fields of the message; it does not descend into
submessages to count their fields recursively.
Parameter Description
numFields Long
TibrvMsg.getOutboundEncoding()
Method
Remarks If no global value is set, this call yields vbNullString and returns normally.
Parameter Description
encoding String
TibrvMsg.getProperty()
Method
Remarks Properties are supplementary information—they are not part of the message itself.
Parameter Description
name String
value Object
Property Description
cmSender String
cmSequenceNumber TibrvInt64
cmSequence The sequence number of labeled message.
(either name extracts When the message is not labeled with this CM property, the method
the same property) reports the error TIBRVCOM_NOT_FOUND, and the TibrvInt64 contains zero.
cmTimeLimit Double
TibrvMsg.getReplySubject()
Method
Remarks The reply subject string is part of a message’s address information—it is not part
of the message itself.
Parameter Description
replySubject String
TibrvMsg.getSendSubject()
Method
Remarks The subject string is part of a message’s address information—it is not part of the
message itself.
Parameter Description
sendSubject String
TibrvMsg.isDetached()
Method
Parameter Description
isDetached Boolean
TibrvMsg.isValid()
Method
Parameter Description
isValid Boolean
TibrvMsg.markReferences
Method
Declaration TibrvMsg.markReferences
Remarks Extracting a field object from a message creates a snapshot of that data. When the
field contains a reference datatype, the snapshot is a reference that depends on the
parent message. A reference snapshot remains associated with the message until
the program destroys the message. Repeatedly extracting field objects can cause
reference snapshots to accumulate within a program, causing unbounded
memory growth. This method 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 extract a message field object.
For example, consider a program fragment that repeatedly sends a template
message, extracting field objects from the message before each send call. Each call
to extract a field produces a snapshot reference. By surrounding the getField
operation with a mark and clear pair (with the clear call occurring at any time after
the getField 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 3 on page 78 illustrates that each clear call deletes snapshots
back to the most recent mark.
Unless a program explicitly marks and clears references, references persist until
the message is destroyed or reset.
Example This first code fragment exits the loop with 10000 unneeded references to the field
named myFld:
For i = 1 to 10000
set myFld = msg.getField("fld_name") ’Creates a snapshot refr
...myFld.getData()... ’Uses the reference
next i
This second code fragment clears the reference at the end of each iteration:
For i = 1 to 10000
msg.markReferences
set myFld = msg.getField("fld_name") ’Creates a snapshot refr
...myFld.getData()... ’Uses the reference
msg.clearReferences
next i
Mark 1
Pointer to
Array
Snapshot
Value
1
Snapshot 1
Mark 2
Pointer to
Array
Snapshot
Value
2
Snapshot 2
TibrvMsg.remove
Method
Parameter Description
fieldName String
Field Search This method uses this algorithm to find and remove a field within a message, as
Algorithm specified by a field identifier and a field name.
1. If the program supplied zero as the identifier, or omitted any identifier, then
begin 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 the search does not find a field, 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.
On the search does not find a field, or if the program supplied vbNullString
as the field name, report the error TIBRVCOM_NOT_FOUND.
If the name search succeeds, but the actual identifier in the field is non-zero
(so it does not match the identifier supplied) then report the error
TIBRVCOM_ID_CONFLICT.
If a message contains several fields with the same name, searching by name
removes the first instance of the field with that name.
TibrvMsg.removeInstance
Method
Remarks 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 method 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 method reports the error
TIBRVCOM_NOT_FOUND.
Parameter Description
fieldName String
instance Long
TibrvMsg.reset
Method
Declaration TibrvMsg.reset
Remarks This method is the equivalent of destroying the message object and creating a
new, except that the new object re-uses the same storage for the outer message
object.
When this method returns, the message has no fields; it is like a newly created
message. The message’s address information and other properties are also reset.
Snapshot references of the old message are freed. Field objects previously
extracted from the old message may contain references into the freed storage.
TibrvMsg.setDefaultInboundEncoding
Method
Parameter Description
encoding String
TibrvMsg.setOutboundEncoding
Method
Remarks Outbound messages bear this tag, indicating the encoding of all strings within the
message.
When no global encoding is set, outbound messages do not bear any encoding
tag.
Parameter Description
encoding String
TibrvMsg.setProperty
Method
Remarks Properties are supplementary information—they are not part of the message itself.
Parameter Description
name String
value Object
Property Description
cmTimeLimit Double
TibrvMsg.setReplySubject
Method
Remarks A receiver can reply to an inbound message using its reply subject.
Rendezvous routing daemons modify subjects and reply subjects to enable
transparent point-to-point communication across network boundaries. This
modification does not apply to subject names stored in message data fields; we
discourage storing point-to-point subject names in data fields.
Parameter Description
replySubject String
TibrvMsg.setSendSubject
Method
Remarks The subject of a message can describe its content, as well as its destination set.
Rendezvous routing daemons modify subjects and reply subjects to enable
transparent point-to-point communication across network boundaries. This
modification does not apply to subject names stored in message data fields; we
discourage storing point-to-point subject names in data fields.
Parameter Description
sendSubject String
TibrvMsg.toString()
Method
Remarks Programs can use this method to obtain a string representation of the message for
printing.
For most datatypes, this method formats the full value of each field to the output
string; however, these two types are exceptions:
TIBRVCOM_MSG_OPAQUE This method abbreviates the value of an opaque field;
for example, [472 opaque bytes].
TIBRVCOM_MSG_XML This method abbreviates the value of an XML field; for
example, [XML document: 472 bytes].
The size measures uncompressed data.
Parameter Description
formattedString String
Converting TibrvMsg.toString() prints times in UTC format (also known as Zulu time or
Dates to Strings GMT). The ISO-8601 standard requires appending a Z character in this notation.
TibrvMsg.toString() 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.update
Method
Remarks This method copies the new data into the message field.
This method locates a field within the message by matching the fieldName and
fieldId arguments. Then it updates the message field using the data argument.
(Notice that the program may not supply a different field name, field identifier, or
datatype.)
If no existing field matches the specifications in the fieldName and fieldId
arguments, then this method adds a new field to the message.
The type of the existing message field and the updating tibrvType argument
must be identical; otherwise, the method reports the error
TIBRVCOM_INVALID_TYPE.
When updating, a new array may have a different count (number of elements); a
new string, opaque or XML may have different length.
(Sheet 1 of 2)
Parameter Description
fieldName String
Update a field with this name. See Field Search Algorithm on page 90.
vbNullString is a legal name. However, if fieldId is non-zero, then
fieldName must be non-null.
data Object
(Sheet 2 of 2)
Parameter Description
tibrvType Byte optional
Update a field with this type.
When absent or zero, determine the field’s type from the type of the data.
Default encodings and possible conversions are identical to methods that add
fields; see Figure 1 on page 47.
If the search fails, add the field as specified (with name and identifier).
However, if the program supplied vbNullString as the field name, then do
not search for the field name; instead, report the error TIBRVCOM_NOT_FOUND.
3. When the program supplied zero as the identifier, or omitted any identifier,
then begin here.
Search for a field with the specified name—even if that name is
vbNullString.
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.
Nested Message When the new value is a message object, this method uses only the data portion of
the nested message (data); it does not include any subject address information or
certified delivery information.
TibrvMsg.updateField
Method
Remarks This method copies the new data into the existing message field.
This method locates a field within the message by matching the name and
identifier of the field argument. Then it updates the message field using the data
of the field object. (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 object’s name and
identifier, then this method adds a new field to the message.
The type of the existing message field and the type of the updating field
argument must be identical; otherwise, the method reports the error
TIBRVCOM_INVALID_TYPE.
When updating, a new array may have a different count (number of elements); a
new string, opaque or XML may have different length.
Parameter Description
field TibrvMsgField
TibrvMsgField
Class
(Sheet 1 of 2)
(Sheet 2 of 2)
TibrvMsgField.getData()
Method
Remarks This method always yields an independent snapshot copy of the field data—as
does TibrvMsg.get().
Field Description
data Object
When a field object contains a reference datatype (array, message, opaque, XML,
or string), the data in the field object depends on a reference into the parent
message. If the parent message is deleted, the program can no longer extract these
datatypes from the field object; attempting to extract them references freed
storage, which is illegal, and can cause serious consequences.
TibrvMsgField.getId()
Method
Field Description
fieldId Long
TibrvMsgField.getName()
Method
Field Description
fieldName String
TibrvMsgField.getType()
Method
Field Description
tibrvType Byte
TibrvMsgField.initialize
Method
Remarks This method does not verify that the data and type of the field are consistent.
Methods that add the field object into a message verify consistency (for example
TibrvMsg.addField and TibrvMsg.updateField).
When a program creates a field object (using the New operator), the program owns
the object, and can initialize it using this method—even repeatedly. This method
discards any old field content, and replaces it with the new content from the
method’s arguments.
(Sheet 1 of 2)
Parameter Description
fieldName String
data Object
(Sheet 2 of 2)
Parameter Description
fieldId Long optional
Store this identifier in the field object. All field identifiers must be unique
within each message.
An identifier has the range of a 16-bit unsigned integer, [0, 65535].
When absent or zero, add a field without an identifier.
Zero is a special value, indicating no identifier. It is illegal to add a field that
has both a null field name and a non-zero field identifier.
TibrvInt64
Class
Remarks Inbound messages can contain 64-bit integers, which COM and VB do not directly
support. Programs can store signed or unsigned 64-bit values in this object; it is
the responsibility of the program to use the high-order bit consistently (either as a
sign bit or a value bit).
Certified delivery software attaches 64-bit sequence numbers to messages.
TIBRVCOM includes this object to represent those sequence numbers.
TibrvInt64.getAsHexString()
Method
Remarks Notice that hexidecimal strings avoid confusion regarding the sign bit.
Parameter Description
stringValue String
TibrvInt64.getAsString()
Method
Purpose Get the value of a 64-bit integer as a string, interpreting the high order bit as a sign
bit.
Parameter Description
stringValue String
TibrvInt64.getAsUnsignedString()
Method
Purpose Get the value of a 64-bit integer as a string, interpreting the high order bit as a
value bit (rather than a sign bit).
Parameter Description
stringValue String
TibrvInt64.getLowOrderPart()
Method
Remarks If the high order bit of this part is set, the value appears as a negative integer.
Parameter Description
lowOrderPart Long
TibrvInt64.getHighOrderPart()
Method
Remarks If the high order bit of this part is set, the value appears as a negative integer.
Parameter Description
lowOrderPart Long
TibrvInt64.setFromString
Method
Remarks This method parses a string of decimal digits, truncating any fractional part.
String values can be in the range [-263, 264-1], that is,
[-9223372036854775808, +18446744073709551615]. Notice that this range
overloads the high-order bit, using it as a sign bit for string values less than zero,
and as a value bit for string values greater than 263-1. It is the responsibility of the
program to use the high-order bit consistently (either as a sign bit or a value bit).
Values outside the range [-263, 264-1] yield incorrect results, but do not produce
errors.
Parameter Description
stringValue String
Recommendations
For the type TIBRVCOM_MSG_I64, limit values to the range
[-9223372036854775808, +9223372036854775807]. Some operating system
platforms cannot correctly construct -9223372036854775808; instead, they limit the
minimum to -9223372036854775807.
For the type TIBRVCOM_MSG_U64, limit values to the range
[0, +18446744073709551615].
(Note that extracting this object from a message field does not retain the original
type designator.)
Topics
See Also
Objects, page 4
Callback Methods and Event Handlers, page 6
Tibrv.getAutoDispatchQueueGroup() on page 20
TibrvListener
Class
Remarks A listener object continues listening for messages until the program destroys or
deletes it.
Destroying the queue or transport of a listener automatically destroys the listener
as well, but does not delete the COM listener object.
Callback Method
Properties
from the queue, and runs the callback method to process the message. (To stop
receiving inbound messages on the subject, destroy or delete the listener object;
this action cancels all messages already queued for the listener; see also
TibrvListener.destroy on page 114.)
Figure 4 illustrates that messages can continue to accumulate in the queue, even
while the callback method is processing.
3. Dispatch event.
Callback
Event Waiting in
Function
Queue
Running
Callback
Event Waiting in Queue Function
Running
Callback
Event Waiting in Queue Function
Running
6. Destroying listener
Event Waiting in
More messages arrive. cancels messages in
Queue
the queue.
TibrvListener.create
Method
Remarks For each inbound message, place this object on the event queue.
Starting a listener requires three steps:
1. Declare a variable for the listener.
Dim WithEvents myListener as TibrvListener
Parameter Description
queue TibrvQueue
transport TibrvTransport
subject String
closure Object
TibrvListener.destroy
Method
Declaration TibrvListener.destroy
Purpose Destroy the internal structure of a listener, canceling interest in its inbound
messages.
Remarks This method destroys only the internal structure of the listener object.
Rendezvous software automatically destroys a listener (using this method) when
program execution leaves the scope of the object, or sets the object to Nothing.
Destroying a listener object cancels interest in it. Upon return from
TibrvListener.destroy, the destroyed listener’s message events are no longer
dispatched. However, an active callback method of this listener continues to run
and return normally, even though the listener is invalid.
It is legal for a listener callback method to destroy its own listener object.
TibrvListener.getClosure()
Method
Parameter Description
closure Object
TibrvListener.getQueue()
Method
Parameter Description
queue TibrvQueue
TibrvListener.getSubject()
Method
Parameter Description
subject String
TibrvListener.getTransport()
Method
Parameter Description
transport TibrvTransport
TibrvListener.isValid()
Method
Parameter Description
isValid Boolean
TibrvListener_onMsg
Method
Parameter Description
listener TibrvListener
message TibrvMsg
CM Label The callback method for certified delivery messages can use the certified delivery
Information label property cmSender to discriminate these situations:
• If extracting the cmSender property yields the error TIBRVCOM_NOT_FOUND,
then the message uses the reliable protocol (that is, it was sent from an
ordinary transport).
• If the cmSender property is a valid sender name, then the message uses the
certified delivery protocol (that is, it is a labeled message, sent from a certified
delivery transport).
TibrvTimer
Class
Remarks All timers are repeating timers. To simulate a once-only timer, code the callback
method to destroy the timer. To stop the timer, destroy or delete it.
Destroying the queue of a timer automatically destroys the timer as well.
However, the program must also delete the timer object to reclaim resources.
Callback Method
Properties
event, using the same interval. On dispatch Rendezvous 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 TibrvTimer.destroy
on page 126.)
Notice that time waiting in the event queue until dispatch can increase the
effective interval of the timer. It is the programmer’s responsibility to ensure
timely dispatch of events.
Figure 5 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 once—not
several times as multiple copies. Nonetheless, Rendezvous 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 methods 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.
1. Activate timer.
Zero as Interval Many programmers traditionally implement user events as timers with interval
zero. Instead, we recommend implementing user events as messages on the
intra-process transport. For more information, see Intra-Process Transport and
User Events on page 114 in TIBCO Rendezvous Concepts.
TibrvTimer.create
Method
Remarks All timers are repeating timers. To simulate a once-only timer, code the callback
method to destroy the timer. To stop a timer, destroy or delete it.
Starting a timer requires three steps:
1. Declare a variable for the timer.
Dim WithEvents myTimer as TibrvTimer
Parameter Description
queue TibrvQueue
interval Double
closure Object
Timer Express the timer interval (in seconds) as a double (64-bit floating point number).
Granularity This representation allows microsecond granularity for intervals for over 100
years. The actual granularity of intervals depends on VB, hardware and operating
system constraints.
TibrvTimer.destroy
Method
Declaration TibrvTimer.destroy
Remarks This method destroys only the internal structure of the timer object. Rendezvous
software automatically destroys a timer (using this method) when program
execution leaves the scope of the object, or deletes the object.
Destroying a timer object cancels interest in it. Upon return from
TibrvTimer.destroy, the destroyed timer is no longer dispatched. However, an
active callback method of this timer continues to run and return normally, even
though the timer object is invalid.
It is legal for a timer callback method to destroy its own timer object.
TibrvTimer.getClosure()
Method
Parameter Description
closure Object
TibrvTimer.getInterval()
Method
Parameter Description
interval Double
TibrvTimer.getQueue()
Method
Parameter Description
queue TibrvQueue
TibrvTimer.isValid()
Method
Remarks Notice that TibrvTimer.destroy invalidates the timer immediately, even though
active callback methods may continue to run.
Parameter Description
isValid Boolean
TibrvTimer_onTimer
Method
Parameter Description
timer TibrvTimer
TibrvTimer.resetInterval
Method
Parameter Description
newInterval Double
Timer Express the timer interval (in seconds) as a 64-bit floating point number. This
Granularity representation allows microsecond granularity for intervals for over 100 years.
The actual granularity of intervals depends on VB, hardware and operating
system constraints.
Limit of This method can affect a timer only before or during its interval—but not after its
Effectiveness interval has elapsed.
This method neither examines, changes nor removes a timer 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.)
TibrvQueue
Class
Remarks Each listener and timer object is associated with a TibrvQueue object; when the
event occurs, Rendezvous software places the object in its queue. Programs
dispatch queues to process events.
Default Queue Programs that need only one event queue can use the 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).
Rendezvous software places all advisories pertaining to queue overflow on the
default queue.
Programs cannot destroy the default queue. Programs cannot change the
parameters of the default queue.
For more information, see Tibrv.getDefaultQueue() on page 21.
Priority 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.
Automatic A special queue group, called the automatic dispatch queue group, detects the
Dispatch Queue presence of an event in any of its queues, and automatically dispatches the queues
Group (according to their priority) until no more events are waiting. To automatically
dispatch a queue, add it to that queue group. To retrieve that queue group, see
Tibrv.getAutoDispatchQueueGroup() on page 20.
Limit Policy The type library defines these constants, which specify the possible strategies for
resolving overflow of queue limit.
(Sheet 1 of 2)
Constant Description
TIBRVCOM_QUEUE_DEFAULT_POLICY Never discard events; use this policy when a
TIBRVCOM_QUEUE_DISCARD_NONE queue has no limit on then number of events it
can contain.
(Sheet 2 of 2)
Constant Description
TIBRVCOM_QUEUE_DISCARD_LAST Discard the last event in the queue (that is, the
youngest event in the queue).
(Sheet 1 of 2)
Dispatch
Properties
(Sheet 2 of 2)
TibrvQueue.create
Method
Declaration TibrvQueue.create
discardAmount zero
TibrvQueue.destroy
Method
Declaration TibrvQueue.destroy
Remarks This method destroys the internal mechanism of the queue, leaving an unusable
object. Rendezvous software automatically destroys a queue (using this method)
when program execution leaves the scope of the object, or the program deletes the
object.
When a queue is destroyed, events that remain in the queue are discarded.
Dispatch calls report an error. Automatic dispatch ignores the destroyed queue.
It is safe to call TibrvQueue.destroy more than once on the same object. Repeat
calls return without error.
Programs cannot destroy the default queue.
TibrvQueue.dispatch
Method
Declaration TibrvQueue.dispatch
Remarks 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.
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
Blocking effectively freezes the GUI operation of a program. Use with caution.
We recommend automatic dispatch instead.
TibrvQueue.getCount()
Method
Parameter Description
numEvents Long
TibrvQueue.getDiscardAmount()
Method
Remarks When the queue exceeds its maximum event limit, discard a block of events. This
property specifies the number of events to discard.
Parameter Description
discardAmount Long
TibrvQueue.getLimitPolicy()
Method
Remarks 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
Limit Policy on page 133.
Parameter Description
limitPolicy Long
TibrvQueue.getMaxEvents()
Method
Remarks Programs can limit the number events that a queue can hold—either to curb
queue growth, or implement a specialized dispatch semantics.
Zero specifies an unlimited number of events.
Parameter Description
maxEvents Long
TibrvQueue.getName()
Method
Parameter Description
queueName String
TibrvQueue.getPriority()
Method
Remarks 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 Description
priority Long
TibrvQueue.isValid()
Method
Parameter Description
isValid Boolean
TibrvQueue.poll
Method
Declaration TibrvQueue.poll
Remarks 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,
reporting the error TIBRVCOM_TIMEOUT.
This call is equivalent to timedDispatch(0.0).
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
TibrvQueue.setLimitPolicy
Method
Remarks This method simultaneously sets three related properties, which together describe
the behavior of a queue in overflow situations. Each call must explicitly specify all
three properties.
Parameter Description
limitPolicy Long
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 Limit
Policy on page 133.
When maxEvents is zero (unlimited), the policy must be
TIBRVCOM_QUEUE_DISCARD_NONE.
maxEvents Long
Programs can limit the number events that a queue can hold—either to curb
queue growth, or implement a specialized dispatch semantics.
Zero specifies an unlimited number of events; in this case, the policy must be
TIBRVCOM_QUEUE_DISCARD_NONE.
discardAmount Long
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
TIBRVCOM_QUEUE_DISCARD_NONE.
TibrvQueue.setName
Method
Parameter Description
queueName String
TibrvQueue.setPriority
Method
Remarks 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 Description
priority Long
TibrvQueue.timedDispatch
Method
Purpose Dispatch an event, but if no event is ready to dispatch, limit the time that this call
blocks while waiting for an event.
Remarks 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,
reporting the error TIBRVCOM_TIMEOUT.
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
Parameter Description
timeout Double
Maximum time (in seconds) that this call can block while
waiting for an event to arrive in the queue.
Zero indicates no blocking (immediate timeout).
-1 indicates no timeout.
Blocking effectively freezes the GUI operation of a program. Use with caution.
We recommend automatic dispatch instead.
Constants The type library defines these constants for use with timed dispatch methods.
Constant Value
TIBRVCOM_WAIT_FOREVER -1
TIBRVCOM_NO_WAIT 0
TibrvQueueGroup
Class
Remarks 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.
Priority 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.
Automatic A special queue group, called the automatic dispatch queue group, detects the
Dispatch Queue presence of an event in any of its queues, and automatically dispatches the queues
Group (according to their priority) until no more events are waiting. To automatically
dispatch a queue, add it to that queue group. To stop automatic dispatch, remove
all queues from that group. To retrieve that queue group, see
Tibrv.getAutoDispatchQueueGroup() on page 20.
(Sheet 1 of 2)
Queues
Dispatch
(Sheet 2 of 2)
TibrvQueueGroup.add
Method
Remarks If the queue is already in the group, adding it again has no effect.
If either the queue or the group is invalid, this method reports an error.
Parameter Description
queue TibrvQueue
TibrvQueueGroup.create
Method
Declaration TibrvQueueGroup.create
TibrvQueueGroup.destroy
Method
Declaration TibrvQueueGroup.destroy
Remarks This method destroys the internal mechanism of the group, leaving an unusable
object. Rendezvous software automatically destroys a queue group (using this
method) when program execution leaves the scope of the object, or sets the object
to Nothing.
The individual queues in the group continue to exist, even though the group has
been destroyed.
Programs cannot destroy the automatic dispatch queue group. Attempts to
destroy it return without error.
TibrvQueueGroup.dispatch
Method
Declaration TibrvQueueGroup.dispatch
Remarks 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.
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
Blocking effectively freezes the GUI operation of a program. Use with caution.
We recommend automatic dispatch instead.
TibrvQueueGroup.isValid()
Method
Parameter Description
isValid Boolean
TibrvQueueGroup.poll
Method
Declaration TibrvQueueGroup.poll
Remarks 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,
then this call returns immediately, reporting the error TIBRVCOM_TIMEOUT.
When searching the group for a non-empty queue, this call searches according the
to 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.
This call is equivalent to timedDispatch(0.0).
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
TibrvQueueGroup.remove
Method
Remarks If the queue is not in the group, or if the group is invalid, this call reports the error
TIBRVCOM_INVALID_QUEUE.
Parameter Description
queue TibrvQueue
TibrvQueueGroup.timedDispatch
Method
Purpose Dispatch an event, but if no event is ready to dispatch, limit the time that this call
blocks while waiting for an event.
Remarks 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, reporting the error
TIBRVCOM_TIMEOUT.
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.
The Rendezvous component does not trigger dispatch while a program callback
method is already running. When a program attempts to explicitly dispatch (in
violation of this protective rule), the dispatch method reports the error
TIBRVCOM_EVENT_CALLBACK_ACTIVE.
Parameter Description
timeout Double
Maximum time (in seconds) that this call can block while
waiting for an event to arrive in the queue group.
Zero indicates no blocking (immediate timeout).
-1 indicates no timeout.
Blocking effectively freezes the GUI operation of a program. Use with caution.
We recommend automatic dispatch instead.
Constants The type library defines these constants for use with timed dispatch methods.
Constant Value
TIBRVCOM_WAIT_FOREVER -1
TIBRVCOM_NO_WAIT 0
Chapter 6 Transports
Topics
See Also
Virtual Circuits on page 183
TibrvCmTransport on page 238
Distributed Queue Transport on page 276
TibrvTransport
Class
(Sheet 1 of 2)
Inbox Names
Send Messages
Accessors
(Sheet 2 of 2)
Virtual Circuits
TibrvTransport.create
Method
(Sheet 1 of 2)
Parameter Description
service String
The Rendezvous 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 on more than one service, a program must create more than one
transport—one transport for each service.
You can specify the service in several ways. For details, see Service Parameter on
page 103 in TIBCO Rendezvous Concepts.
The empty string and vbNullString both specify the default rendezvous
service.
(Sheet 2 of 2)
Parameter Description
network String
daemon String
The daemon parameter instructs the transport object about how and where to
find the Rendezvous daemon and establish communication.
For details, see Daemon Parameter on page 110 in TIBCO Rendezvous Concepts.
You can specify a daemon on a remote computer. For details, see Remote
Daemon on page 111 in TIBCO Rendezvous Concepts.
If you specify a secure daemon, this string must be identical to as the
daemonName argument of TibrvSdContext.setDaemonCert() on page 27. See also,
Secure Daemon on page 111 in TIBCO Rendezvous Concepts.
The empty string and vbNullString both specify the default—find the local
daemon on TCP socket 7500. (These defaults are not valid when the local
daemon is a secure daemon.)
licenseTicket String
Embed this special license ticket in the transport object. When a licensed
transport connects to rvd, it presents this special ticket to validate its connection
(rvd uses the longest-running ticket available, which can be either this special
ticket, or a ticket from the ticket file, tibrv.tkt).
Ordinary license tickets are not valid for this parameter; see also, Embedded
License on page 168.
Description As a debugging aid, we recommend setting a unique description string for each
String transport. Use a string that distinguishes both the application and the role of the
transport within it. See TibrvTransport.setDescription on page 181.
Embedded Specially-licensed third-party developers can use the second form of this method.
License 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 Rendezvous to use the program.
To purchase an embedded license, contact TIBCO Software Inc.
TibrvTransport.createInbox()
Method
Parameter Description
inboxSubject String
Remarks This method 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 domain—that 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 throughout the
process.
This method 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 TibrvListener.create. The inbox name is only valid for
use with the same transport that created it. When calling
TibrvListener.create, 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.
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.
Rendezvous 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.
Calling this method on a valid object yields the error
TIBRVCOM_ALREADY_INITIALIZED.
This method is the only legal way for programs to create inbox subject names.
TibrvTransport.destroy
Method
Declaration TibrvTransport.destroy
Remarks This method destroys the internal mechanism of the transport, leaving an
unusable object. Rendezvous software automatically destroys a transport (using
this method) when program execution leaves the scope of the object, or sets the
object to Nothing.
Destroying a transport achieves these effects:
• The transport flushes all outbound data to the Rendezvous daemon.
This effect is especially important.
• The transport invalidates all its listeners.
• Subsequent calls to other methods that use the destroyed transport report an
error (usually TIBRVCOM_OBJECT_NOT_INITIALIZED).
Storage for the transport object is freed when all listeners that use it have been
deleted.
TibrvTransport.getDaemon()
Method
Purpose Return the TCP socket where this transport connects to the Rendezvous daemon.
Parameter Description
daemon String
TibrvTransport.getDescription()
Method
Parameter Description
description String
TibrvTransport.getNetwork()
Method
Purpose Return the network interface that this transport uses for communication.
Parameter Description
network String
TibrvTransport.getService()
Method
Purpose Return the effective service that this transport uses for communication.
Parameter Description
service String
TibrvTransport.isValid()
Method
Parameter Description
isValid Boolean
TibrvTransport.send
Method
Remarks The message must have a valid destination subject; see TibrvMsg.setSendSubject
on page 87.
Parameter Description
message TibrvMsg
TibrvTransport.sendReply
Method
Remarks This convenience call 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 method overwrites any existing send subject of the reply message with the
reply subject of the request message.
Parameter Description
replyMessage TibrvMsg
requestMessage TibrvMsg
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).
TibrvTransport.sendRequest()
Method
This call blocks all other activity in the program, including event dispatch and
GUI operation. Use with caution.
Parameter Description
message TibrvMsg
timeout Double
Maximum time (in seconds) that this call can block while
waiting for a reply.
-1 indicates no timeout (wait without limit for a reply).
replyMessage TibrvMsg
Remarks Programs that receive and process the request message cannot determine that the
sender has blocked until a reply arrives.
The request message must have a valid destination subject; see
TibrvMsg.setSendSubject on page 87.
The program owns the reply message object, and must delete it to reclaim its
storage.
TibrvTransport.setBatchMode
Method
Remarks The batch mode determines when the transport transmits outbound message data
to rvd:
• As soon as possible (the initial default for all transports)
• Either when its buffer is full, or when a timer interval expires—either event
triggers transmission to the daemon
Parameter Description
mode Use this value as the new batch mode.
Constants The type library defines these constants for use with this method.
Constant Description
TIBRVCOM_TRANSPORT_DEFAULT_BATCH Default batch behavior. The transport transmits
outbound messages to rvd as soon as possible.
This value is the initial default for all transports.
TibrvTransport.setDescription
Method
Parameter Description
description String
Topics
Broken Connection
The following conditions can close a virtual circuit connection:
• Contact is broken between the object and its terminal.
• The virtual circuit loses data in either direction (see DATALOSS on page 272
in TIBCO Rendezvous Concepts).
• The partner program destroys its terminal object (or that terminal becomes
invalid).
Destroying VC Transports
Programs must explicitly destroy each virtual circuit transport object. Destroying
a transport object precludes subsequent communications on that transport, and
frees its storage. Attempting to use a destroyed transport in any way is an error.
Destroying a virtual circuit transport does not affect the ordinary transport that
the terminal employs.
Direct Communication
Because virtual circuits rely on point-to-point messages between the two
terminals, they can use direct communication to good advantage. To do so, both
terminals must use network transports that enable direct communication.
For an overview, see Direct Communication on page 116 in TIBCO Rendezvous
Concepts.
For programming details, see Specifying Direct Communication on page 105 in
TIBCO Rendezvous Concepts.
TibrvTransport.createAcceptVc()
Method
Remarks Note that programs call this method on an ordinary transport. The method creates
and returns a new accept transport object that employs the ordinary transport.
Programs may use the ordinary transport for other purposes.
It is illegal to call this method on a virtual circuit terminal transport object (that is,
you cannot nest a virtual circuit within another virtual circuit).
After this method returns, programs must extract the connect subject; see
TibrvTransport.getVcConnectSubject() on page 189.
Parameter Description
vcTransport TibrvTransport
This method creates and returns an accept transport object that employs the
ordinary transport object for communications.
Test Before Either of two conditions indicate that the connection is ready to use:
Using
• The terminal transport presents the VC.CONNECTED advisory.
• TibrvTransport.waitForVcConnection returns without error.
Immediately after this call, test both conditions with these two steps (in this
order):
1. Listen on the virtual circuit transport object for the VC.CONNECTED advisory.
2. Call TibrvTransport.waitForVcConnection with TIBRVCOM_NO_WAIT as the
timeout parameter.
For an explanation, see Testing the New Connection on page 123 in TIBCO
Rendezvous Concepts.
TibrvTransport.createConnectVc()
Method
Remarks Note that programs call this method on an ordinary transport. The method creates
and returns a new connect transport object that employs the ordinary transport.
Programs may use the ordinary transport for other purposes.
It is illegal to call this method on a virtual circuit terminal transport object (that is,
you cannot nest a virtual circuit within another virtual circuit).
Parameter Description
vcTransport TibrvTransport
This method creates and returns a connect transport object that employs the
ordinary transport object for communications.
connectSubject String
The connect transport uses this connect subject to establish a virtual circuit
with an accept transport in another program.
The program must receive this connect subject from the accepting program.
The call to TibrvTransport.createAcceptVc() creates this subject.
Test Before Either of two conditions indicate that the connection is ready to use:
Using
• The transport presents the VC.CONNECTED advisory.
• TibrvTransport.waitForVcConnection returns without error.
Immediately after this call, test both conditions with these two steps (in this
order):
1. Listen on the virtual circuit transport object for the VC.CONNECTED advisory.
2. Call TibrvTransport.waitForVcConnection with TIBRVCOM_NO_WAIT as the
timeout parameter.
For an explanation, see Testing the New Connection on page 123 in TIBCO
Rendezvous Concepts.
TibrvTransport.getVcConnectSubject()
Method
Remarks After creating an accept terminal, the program must use this method to extract its
connect subject, and send it in a message to another program, inviting it to
establish a virtual circuit. Furthermore, the reply subject of that invitation message
must be this connect subject. To complete the virtual circuit, the second program
must extract this subject from the invitation, and supply it to
TibrvTransport.createConnectVc().
It is an error to call this method on any object other than a virtual circuit accept
terminal.
Parameter Description
connectSubject String
The method returns the connect subject of a virtual circuit accept transport.
After this call returns, the program must send a message to another program,
inviting it to establish a virtual circuit. Furtherer, the reply subject of that
invitation message must be this connect subject. To complete the virtual circuit,
the second program must extract this subject from the invitation, and supply it
to TibrvTransport.createConnectVc().
TibrvTransport.waitForVcConnection
Method
Remarks This method tests (and can block) until this virtual circuit transport object has
established a connection with its opposite terminal. You may call this method for
either an accept terminal or a connect terminal.
With a non-zero argument, this call blocks all other activity in the program,
including automatic dispatch of events and GUI operation. Use with caution.
This method produces the same information as the virtual circuit advisory
messages—but it produces it synchronously (while advisories are asynchronous).
Programs can use this method not only to test the connection, but also to block
until the connection is ready to use.
For example, a program can create a terminal object, then call this method to wait
until the connection completes.
Parameter Description
timeout Double
This parameter determines the behavior of the call:
• For a quick test of current connection status, supply the constant
TIBRVCOM_NO_WAIT. The call returns immediately, without blocking.
Status Description
TIBRVCOM_TIMEOUT The connection is not yet complete, but the non-negative time
limit for waiting has expired.
Topics
TibrvFtMember
Class
Remarks Upon creating the internal structure of this object, the process joins a fault
tolerance group.
By destroying or deleting a member object, the process withdraws its
membership in the fault tolerance group.
Callback Method
Accessors
TibrvFtMember.create
Method
Remarks Upon creating a member object, the process becomes a member of the group.
A process may hold simultaneous memberships in several distinct fault tolerance
groups. For examples, see Multiple Groups on page 219 in TIBCO Rendezvous
Concepts.
Avoid joining the same group twice. It is illegal for a process to maintain more
than one membership in any one fault tolerance group. The method does not
guard against this illegal situation, and results are unpredictable.
Joining a fault tolerance group requires three steps:
1. Declare a variable for the member.
Dim WithEvents myFt as TibrvFtMember
Intervals 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 Step 4: Choose the Intervals on
page 237 in TIBCO Rendezvous Concepts.
(Sheet 1 of 2)
Parameter Description
queue TibrvQueue
Place fault tolerance events for this member on this event queue.
transport TibrvTransport
Use this transport for fault tolerance internal protocol messages (such as
heartbeat messages).
groupName String
Join the fault tolerant group with this name.
The group name must conform to the syntax required for Rendezvous
subject names. For details, see Subject Names on page 61 in TIBCO
Rendezvous Concepts.
weight Long
Weight represents the ability of this member to fulfill its purpose, relative
to other members of the same fault tolerance group. Rendezvous 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; Rendezvous 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 on page 206 in TIBCO
Rendezvous Concepts.
activeGoal Long
Rendezvous fault tolerance software sends callback instructions to
maintain this number of active members.
Acceptable values range from 1 to 65535.
(Sheet 2 of 2)
Parameter Description
heartbeatInterval Double
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 Step 4:
Choose the Intervals on page 237 in TIBCO Rendezvous Concepts.
preparationInterval Double
When the heartbeat signal from one or more active members has been
silent for this interval (in seconds), Rendezvous fault tolerance software
issues an early warning hint (TIBRVCOM_FT_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;
Rendezvous fault tolerance software never issues a
TIBRVCOM_FT_PREPARE_TO_ACTIVATE hint when this value is zero. To
determine the correct value, see Step 4: Choose the Intervals on page 237
in TIBCO Rendezvous Concepts.
activationInterval Double
When the heartbeat signal from one or more active members has been
silent for this interval (in seconds), Rendezvous fault tolerance software
considers the silent member to be lost, and issues the instruction to
activate (TIBRVCOM_FT_ACTIVATE) to the ranking inactive member.
When a new member joins a group, Rendezvous 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 (TIBRVCOM_FT_ACTIVATE) to the new
member.
Then interval must be positive. To determine the correct value, see Step
4: Choose the Intervals on page 237 in TIBCO Rendezvous Concepts.
closure Object
TibrvFtMember.destroy
Method
Declaration TibrvFtMember.destroy
TibrvFtMember.getClosure()
Method
Parameter Description
closure Object
TibrvFtMember.getGroupName()
Method
Parameter Description
groupName String
Return the name of the fault tolerance group.
TibrvFtMember.getQueue()
Method
Parameter Description
queue TibrvQueue
TibrvFtMember.getTransport()
Method
Parameter Description
transport TibrvTransport
TibrvFtMember.getWeight()
Method
Parameter Description
weight Long
TibrvFtMember.isValid()
Method
Remarks Returns True if the member is valid; False if the member has been destroyed or is
otherwise invalid.
Parameter Description
isValid Boolean
TibrvFtMember_onFtAction
Method
Remarks Each member program of a fault tolerance group must implement this method.
Declaring a variable of class TibrvFtMember with events triggers VB to
automatically define a COM event callback, and a private subroutine callback
stub named var_OnFtAction. The program must complete this method for each
member object.
For additional information see Fault Tolerance Callback Actions on page 216 in
TIBCO Rendezvous Concepts.
Parameter Description
ftMember TibrvFtMember
groupName String
action Long
Action Tokens The type library defines constants to represent the fault tolerance actions. Each
token designates a command to a fault tolerance callback method. The program’s
callback method receives one of these tokens in a parameter, and interprets it as
an instruction from the Rendezvous fault tolerance software as described in this
table (see also, Fault Tolerance Callback Actions on page 216 in TIBCO Rendezvous
Concepts).
(Sheet 1 of 2)
Field Description
TIBRVCOM_FT_PREPARE_TO_ACTIVATE Prepare to activate (hint).
Rendezvous fault tolerance software passes this token to
the callback method to instruct the program to make itself
ready to activate on short notice—so that if the callback
method 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.
(Sheet 2 of 2)
Field Description
TIBRVCOM_FT_DEACTIVATE Deactivate immediately.
Rendezvous fault tolerance software passes this token to
the callback method to instruct the program to deactivate.
TibrvFtMember.setWeight
Method
Purpose Change the weight of a fault tolerance member within its group.
Remarks 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; Rendezvous 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 Rendezvous 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 member’s 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 Description
weight Long
See Also Adjusting Member Weights on page 227 in TIBCO Rendezvous Concepts.
TibrvFtMonitor
Class
Remarks Upon creating this object, the program monitors a fault tolerance group.
Monitors are passive—they do not affect the group members in any way.
Rendezvous fault tolerance software queues a monitor event whenever the
number of active members in the group changes—either 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 method receives the number of active members as an
argument.
By destroying a monitor object, the program stops monitoring the fault tolerance
group.
Destroying the queue or transport of a monitor automatically destroys the
monitor as well.
(Sheet 1 of 2)
Callback Method
Accessors
(Sheet 2 of 2)
TibrvFtMonitor.create
Method
Remarks The monitor callback method receives the number of active members as an
argument.
The group need not have any members at the time of this method call.
Monitoring a fault tolerance group requires three steps:
1. Declare a variable for the monitor.
Dim WithEvents myMon as TibrvFtMonitor
(Sheet 1 of 2)
Parameter Description
queue TibrvQueue
transport TibrvTransport
(Sheet 2 of 2)
Parameter Description
groupName String
lostInterval Double
closure Object
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 group’s
activationInterval, so the monitor accurately reflects the behavior of the
group members.
Group Name The group name must be a legal Rendezvous subject name (see Subject Names on
page 61 in TIBCO Rendezvous Concepts). You may use names with several
elements; for examples, see Multiple Groups on page 219 in TIBCO Rendezvous
Concepts.
TibrvFtMonitor.destroy
Method
Declaration TibrvFtMonitor.destroy
Purpose Stop monitoring a fault tolerance group, and free associated resources.
Remarks This method destroys only the internal structure of the monitor object.
Rendezvous software automatically destroys a monitor (using this method) when
program execution leaves the scope of the object, or sets the object to Nothing.
TibrvFtMonitor.getClosure()
Method
Parameter Description
closure Object
TibrvFtMonitor.getGroupName()
Method
Parameter Description
groupName String
Return the name of the fault tolerance group.
TibrvFtMonitor.getQueue()
Method
Parameter Description
queue TibrvQueue
TibrvFtMonitor.getTransport()
Method
Parameter Description
transport TibrvTransport
TibrvFtMonitor.isValid()
Method
Remarks Returns True if the monitor is valid; False if the monitor has been destroyed or is
otherwise invalid.
Parameter Description
isValid Boolean
TibrvFtMonitor_onFtMonitor
Remarks A program must define a method of this type as a prerequisite to monitor a fault
tolerance group. Declaring a variable of class TibrvFtMonitor with events
triggers VB to automatically define a COM event callback, and a private
subroutine callback stub named var_OnFtMonitor. The program must complete
this method for each member object.
Rendezvous 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 method.
This method receives its parameters by value, so it cannot delete them.
To stop monitoring, destroy the original monitor object associated with this
callback method.
Parameter Description
ftMonitor TibrvFtMonitor
groupName String
numActiveMembers Long
See Also
This API implements Rendezvous certified delivery features. For a complete
discussion, see Certified Message Delivery on page 139 in TIBCO Rendezvous
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 on page 291 in TIBCO Rendezvous Concepts.
If your application sends or receives certified messages across network
boundaries, you must configure the Rendezvous routing daemons to exchange
_RVCM administrative messages. For details, see Certified Message Delivery on
page 403 in TIBCO Rendezvous Administration.
Some programs require certified delivery to one of n worker processes. See
Distributed Queue on page 183 in TIBCO Rendezvous Concepts.
Topics
TibrvCmListener
Class
Purpose A certified delivery listener object listens for labeled messages and certified
messages.
(Sheet 1 of 2)
Callback Method
Confirm
Accessors
(Sheet 2 of 2)
TibrvCmListener.confirmMsg
Method
Remarks Use this method only in programs that override automatic confirmation (see
TibrvCmListener.setExplicitConfirm on page 237). The default behavior of
certified listeners is to automatically confirm delivery when the callback method
returns.
Parameter Description
message TibrvMsg
Unregistered When a CM listener receives a labeled message, its behavior depends on context:
Message
• If a CM listener is registered for certified delivery, it presents the
supplementary information to the callback method. 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 sender’s name to the callback method, but omits the sequence
number. In this case, the receiving program cannot confirm delivery;
TibrvCmListener.confirmMsg reports the error TIBRVCOM_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 on page 154 in
TIBCO Rendezvous Concepts.)
A labeled but uncertified message can also result when the sender explicitly
disallows or removes the listener.
TibrvCmListener.create
Method
Purpose Listen for messages that match the subject, and request certified delivery when
available.
Starting a listener requires three steps:
1. Declare a variable for the listener.
Dim WithEvents myCmListener as TibrvCmListener
Parameter Description
queue TibrvQueue
cmTransport TibrvCmTransport
subject String
closure Object
Activation and Details of listener event semantics are identical to those for ordinary listeners; see
Dispatch Activation and Dispatch on page 110.
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 TibrvCmListener.create 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.
TibrvCmListener.destroy
Method
Remarks This method destroys only the internal structure of the listener object.
Rendezvous software automatically destroys a listener (using this method) when
program execution leaves the scope of the object, or sets the object to Nothing.
Destroying an event object cancels interest in it. Upon return from
TibrvCmListener.destroy, the destroyed event is no longer dispatched.
However, an active callback method of this event continues to run and return
normally, even though the event is invalid.
It is legal for an event callback method to destroy its own event.
Parameter Description
cancelAgreements Boolean
Canceling When destroying a certified delivery listener, a program can either cancel its
Agreements 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. Successor listeners cannot receive old
messages.
Deleting an certified delivery listener object (without first destroying it) cancels its
agreements.
TibrvCmListener.getClosure()
Method
Parameter Description
closure Object
TibrvCmListener.getCmTransport()
Method
Parameter Description
cmTransport TibrvCmTransport
TibrvCmListener.getQueue()
Method
Parameter Description
queue TibrvQueue
TibrvCmListener.getSubject()
Method
Parameter Description
subject String
TibrvCmListener.isValid()
Method
Remarks Returns True if the member is valid; False if the member has been destroyed or is
otherwise invalid.
Parameter Description
isValid Boolean
TibrvCmListener_onCmMsg
Method
Parameter Description
cmListener TibrvCmListener
message TibrvMsg
CM Label The callback method for certified delivery messages can use certified delivery
Information label properties to discriminate these situations:
• If extracting the cmSender property yields the error TIBRVCOM_NOT_FOUND,
then the message uses the reliable protocol (that is, it was sent from an
ordinary transport).
• If the cmSender property is a valid sender name, then the message uses the
certified delivery protocol (that is, it is a labeled message, sent from a certified
delivery transport).
Once the callback method determines that the message uses the certified
delivery protocol, it can discriminate further:
— If extracting the cmSequenceNumber property yields the error
TIBRVCOM_NOT_FOUND, then the listener is not registered for certified
delivery from the sender.
— If the cmSequenceNumber property is a positive sequence number, then a
certified delivery agreement is in effect for this subject with the sender.
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 on page 154 in TIBCO
Rendezvous Concepts.)
Release 5 In release 6 (and later) the sequence number is a 64-bit unsigned integer, while in
Interaction 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).
TibrvCmListener.setExplicitConfirm
Method
Declaration TibrvCmListener.setExplicitConfirm
TibrvCmTransport
Class
Purpose A certified delivery transport object implements the CM delivery protocol for
messages.
(Sheet 1 of 3)
Send Messages
(Sheet 2 of 3)
Ledger
(Sheet 3 of 3)
TibrvCmTransport.addListener
Method
Remarks Some sending programs can anticipate requests for certified delivery—even
before the listening programs actually register. In such situations, the sending
transport can pre-register listeners, so Rendezvous software begins storing
outbound messages in the sender’s 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,
TibrvCmTransport.addListener reports the error TIBRVCOM_NOT_PERMITTED.
You can call TibrvCmTransport.allowListener to supersede the effect of a
prior call to TibrvCmTransport.disallowListener; then call
TibrvCmTransport.addListener again.
It is not sufficient for a sender to use this method to anticipate listeners; the
anticipated listening programs must also require old messages when creating
certified delivery transports.
Parameter Description
cmName String
subject String
TibrvCmTransport.allowListener
Method
Purpose Invite the named receiver to reinstate certified delivery for its listeners,
superseding the effect of any previous disallow calls.
Remarks Upon receiving the invitation to reinstate certified delivery, Rendezvous software
at the listening program automatically sends new registration requests. The
sending program accepts these requests, restoring certified delivery.
Parameter Description
cmName String
TibrvCmTransport.connectToRelayAgent
Method
Declaration TibrvCmTransport.connectToRelayAgent
Remarks Programs may specify a relay agent when creating a CM transport object.
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, Rendezvous 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.CONNECTED 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 CM data messages that they have
been storing during the time they were disconnected.
Errors The error code TIBRVCOM_UNABLE indicates that the transport does not have a
relay agent.
TibrvCmTransport.create
Method
Remarks The new certified delivery transport must employ a valid transport for network
communications.
The certified delivery transport remains valid until the program explicitly
destroys it.
Calling this method on a valid object yields the error
TIBRVCOM_ALREADY_INITIALIZED.
(Sheet 1 of 3)
Parameter Description
transport TibrvTransport
(Sheet 2 of 3)
Parameter Description
requestOld Boolean; optional
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 true and cmName is present, then the new TibrvCmTransport
requires certified senders to retain unacknowledged messages sent to this
persistent correspondent. When the new TibrvCmTransport begins listening to the
appropriate subjects, the senders can complete delivery. (It is an error to supply
true when cmName is omitted.)
If this parameter is false (or absent), then the new TibrvCmTransport does not
require certified senders to retain unacknowledged messages. Certified senders
may delete those messages from their ledgers.
(Sheet 3 of 3)
Parameter Description
relayAgent String; optional
Designate the rvrad process with this name as the new transport’s relay agent.
If absent, the empty string ("") or vbNullString, the new TibrvCmTransport does
not use a relay agent.
If non-null, the relay agent name must conform to the syntax rules for reusable
names. For details, see Reusable Names on page 167 in TIBCO Rendezvous Concepts.
It is illegal for a relay agent to have the same name as a CM correspondent.
For more information, see Relay Agent on page 247.
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:
• To specify synchronous writing, supply true. Each time Rendezvous software
writes a ledger item, the call does not return until the data is safely stored in
the storage medium.
• To specify asynchronous writing (the default), supply false. Certified
delivery 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 of 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 274.
Destroying a transport with a file-based ledger always leaves the ledger file intact;
it neither erases nor removes a ledger file.
The ledger file must reside on the same host computer as the program that uses it.
TibrvCmTransport.destroy
Method
Declaration TibrvCmTransport.destroy
Remarks This method destroys only the internal structure of the transport object.
Rendezvous software automatically destroys a transport (using this method)
when program execution leaves the scope of the object, or sets the object to
Nothing.
Distributed When calling this method to destroy a distributed queue transport, the
Queue distributed queue needs the listeners, queues and dispatchers (associated with the
transport) to remain operational—otherwise the distributed queue can lose
reliable (non-certified) task messages before they are processed. Programs must
wait until after the transport has been completely destroyed before destroying
these associated objects.
TibrvCmTransport.disallowListener
Method
Remarks Disallowed listeners still receive subsequent messages from this sender, but
delivery is not certified. In other words:
• The first labeled message causes the listener to initiate registration.
Registration fails, and the listener discards that labeled message.
• The listener receives a REGISTRATION.NOT_CERTIFIED advisory, informing it
that the sender has canceled certified delivery of all subjects.
• If the sender’s ledger contains messages sent to the disallowed listener (for
which this listener has not confirmed delivery), then Rendezvous software
removes those ledger items, and does not attempt to redeliver those messages.
• Rendezvous software presents subsequent messages (from the canceling
sender) to the listener without a sequence number, to indicate that delivery is
not certified.
Senders can promptly revoke the acceptance of certified delivery by calling
TibrvCmTransport.disallowListener within the callback method that
processes the REGISTRATION.REQUEST advisory.
This method 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.
To supersede the effect of TibrvCmTransport.disallowListener, call
TibrvCmTransport.allowListener on page 242.
Parameter Description
cmName String
TibrvCmTransport.disconnectFromRelayAgent
Method
Declaration TibrvCmTransport.disconnectFromRelayAgent
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 events—including 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 on page 157 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.)
Errors The error code TIBRVCOM_UNABLE indicates that the transport does not have a
relay agent.
TibrvCmTransport.expireMessages
Method
Remarks This call checks the ledger for messages that match both the subject and sequence
number criteria, and immediately marks them as expired.
Once a message has expired, the CM transport no longer attempts to redeliver it
to registered listeners.
Rendezvous software presents each expired message to the sender in a
DELIVERY.FAILED advisory. Each advisory includes all the fields of an expired
message. (This call can cause many messages to expire simultaneously.)
Use with extreme caution. This call exempts the expired messages from certified
delivery semantics. It is appropriate only in very few situations.
For example, consider an application program in which an improperly formed
CM message causes registered listeners to exit unexpectedly. When the listeners
restart, the sender attempts to redeliver the offending message, which again
causes the listeners to exit. To break this cycle, the sender can expire the offending
message (along with all prior messages bearing the same subject).
Parameter Description
subject String
sequenceNumber TibrvInt64
TibrvCmTransport.getDefaultTimeLimit()
Method
Purpose Get the default message time limit for all outbound certified messages from a
transport.
Remarks 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.setProperty on page 85). If a time limit is not already set for the
outbound message, the transport sets it to the transport’s default time limit
(extractable with this method); 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 Description
timeLimit Double
Return the default message time limit of the CM transport.
TibrvCmTransport.getLedgerName()
Method
Parameter Description
ledgerName String
Return the ledger file name of the CM transport.
Errors The error code TIBRVCOM_CANNOT_RETRIEVE indicates that the transport does not
have a ledger file.
TibrvCmTransport.getName()
Method
Parameter Description
cmName String
Return the correspondent name of the CM transport.
TibrvCmTransport.getRelayAgent()
Method
Purpose Extract the name of the relay agent used by a certified delivery transport.
Parameter Description
relayAgent String
Return the relay agent name of the CM transport.
Errors The error code TIBRVCOM_CANNOT_RETRIEVE indicates that the transport does not
have a relay agent.
TibrvCmTransport.getRequestOld()
Method
Purpose Extract the request old messages flag of a certified delivery transport.
Parameter Description
requestOld Boolean
Return the request old messages flag of the CM transport.
TibrvCmTransport.getSyncLedger()
Method
Parameter Description
syncLedger Boolean
Return the sync ledger flag of the CM transport.
Errors The error code TIBRVCOM_CANNOT_RETRIEVE indicates that the transport does not
have a ledger file.
TibrvCmTransport.getTransport()
Method
Parameter Description
transport TibrvTransport
TibrvCmTransport.isValid()
Method
Remarks Returns True if the transport is valid; False if the transport has been destroyed or
is otherwise invalid.
Parameter Description
isValid Boolean
TibrvCmTransport_onLedgerMsg
Method
Parameter Description
cmTransport TibrvCmTransport
subject String
message TibrvMsg
closure Object
seqno_last_sent The sequence number of the most recent message sent with this
subject name.
This field has datatype TIBRVCOM_MSG_U64.
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 TIBRVCOM_MSG_I64.
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 TIBRVCOM_MSG_MSG.
listener.name Within each listener submessage, the name field contains the
name of the listener transport.
This field has datatype TIBRVCOM_MSG_STRING.
TibrvCmTransport.removeListener
Method
Remarks This method 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 method 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 method, 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 method
for the advisory.
If the listening correspondent is available (running and reachable), it receives a
REGISTRATION.NOT_CERTIFIED advisory, informing it that the sender no longer
certifies delivery of the subject.
If the correspondent with this name does not receive certified delivery of the
subject from this sender TibrvCmTransport, then
TibrvCmTransport.removeListener reports the error
TIBRVCOM_INVALID_SUBJECT.
Parameter Description
cmName String
subject String
TibrvCmTransport.removeSendState
Method
Background 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 server’s ledger.
As such obsolete records accumulate, the ledger size grows. To counteract this
growth, programs can use this method 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.
Do not use this method to clear subjects that are still in use.
Parameter Description
subject String
Remarks As a side-effect, this method 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.
TibrvCmTransport.reviewLedger
Method
Purpose Query the ledger for stored items related to a subject name.
Remarks The callback method receives one message for each matching subject of outbound
messages stored in the ledger. For example, when FOO.* is the subject,
TibrvCmTransport.reviewLedger calls its callback method separately for each
matching subject—once for FOO.BAR, once for FOO.BAZ, and once for FOO.BOX.
However, if the callback method calls TibrvCmTransport.stopReview, then
TibrvCmTransport.reviewLedger returns immediately (without any further
callbacks).
If the ledger does not contain any matching items,
TibrvCmTransport.reviewLedger returns normally without calling the callback
method.
For information about the content and format of the callback messages, see
TibrvCmTransport_onLedgerMsg on page 261.
Parameter Description
subject String
closure Object
TibrvCmTransport.send
Method
Remarks This method 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 TibrvMsg.setProperty on
page 85. If a time limit is not already set for the outbound message, this method
sets it to the transport’s default time limit (see
TibrvCmTransport.setDefaultTimeLimit on page 271); if that default is not set for
the transport, the default time limit is zero (no time limit).
Parameter Description
message TibrvMsg
TibrvCmTransport.sendReply
Method
Remarks 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 method can send a labeled reply to an ordinary message.
This method automatically registers the requesting CM transport, so the reply
message is certified.
Parameter Description
replyMsg TibrvMsg
requestMsg TibrvMsg
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).
TibrvCmTransport.sendRequest()
Method
Parameter Description
replyMsg TibrvMsg
message TibrvMsg
timeout Double
Maximum time (in seconds) that this call can block while waiting for a reply.
Remarks 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.
The request message must have a valid destination subject; see
TibrvMsg.setSendSubject on page 87.
The program owns the reply message object, and must delete it to reclaim its
storage.
A certified request does not necessarily imply a certified reply; the replying
program determines the type of reply message that it sends.
TibrvCmTransport.setDefaultTimeLimit
Method
Purpose Set the default message time limit for all outbound certified messages from a
transport.
Remarks 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.setProperty on page 85). If a time limit is not already set for the
outbound message, the transport sets it to the transport’s default time limit (set
with this method); 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 Description
timeLimit Double
Use this time limit (in whole seconds). The time limit must be
non-negative. Fractional values are truncated to whole seconds.
TibrvCmTransport.setTaskBacklogLimit...
Method
TibrvCmTransport.setTaskBacklogLimitInMessages limitByMessages
Purpose Set the scheduler task queue limits of a distributed queue transport.
Remarks The scheduler stores tasks in a queue. These properties limit the maximum size of
that queue—by number of bytes or number of messages (or both). When no value
is set for either these properties, the default is no limit.
When the task messages in the queue exceed either of the two limits, Rendezvous
software deletes new inbound task messages.
Programs may call each of these methods at most once. Those calls must occur
before the transport assumes the scheduler role; after a transport acts as a
scheduler, the values are fixed, and subsequent attempts to change them result in
status code TIBRVCOM_NOT_PERMITTED.
Parameter Description
limitBySizeInBytes Long
limitByMessages Long
TibrvCmTransport.stopReview
Method
Declaration TibrvCmTransport.stopReview
TibrvCmTransport.syncLedger
Method
Declaration TibrvCmTransport.syncLedger
Remarks When this method returns, the transport’s current state is safely stored in the
ledger file.
Even when the program does not call this method, Rendezvous software
periodically synchronizes the ledger file.
Transports that use synchronous ledger files need not call this method, since the
current state is automatically written to the storage medium before returning.
Transports that use process-based ledger storage need not call this method, since
they have no ledger file.
Errors The error code TIBRVCOM_UNABLE indicates that the transport does not have a
ledger file.
Programs can use distributed queues for one of n certified delivery to a group of
worker processes.
A distributed queue is a group of distributed queue transport objects, each in a
separate process. From the outside, a distributed queue group appears as though
it were a single transport object; inside, the group members act in concert to
process inbound task messages. Ordinary transports and CM transports can send
task messages to the group. Notice that the senders are not group members, and
do not do anything special to send messages to a group; rather, they send
messages to ordinary subject names. Inside the group, the member acting as
scheduler assigns each task message to exactly one of the other members (which
act as workers); only that worker processes the task message.
Distributed queues depend upon the certified delivery methods and the fault
tolerance methods.
Topics
Disabled Methods
Although each distributed queue transport is an instance of TibrvCmTransport,
all methods related to sending messages are disabled in distributed queue
transports. These disabled methods report the error
TIBRVCOM_INVALID_TRANSPORT_OBJECT. For a list of legal and disabled methods,
see Shared Methods on page 278. See also Certified Delivery Behavior in Queue
Members on page 185 in TIBCO Rendezvous Concepts.
Subscriptions
All members of a distributed queue must listen to exactly the same set of subjects.
See Enforcing Identical Subscriptions on page 186 in TIBCO Rendezvous Concepts.
(Sheet 1 of 2)
(Sheet 2 of 2)
Constants The type library defines these constants for use with distributed queue methods.
Constant Value
TIBRVCOM_CM_DEFAULT_COMPLETE_TIME 0
TIBRVCOM_CM_DEFAULT_WORKER_WEIGHT 1
TIBRVCOM_CM_DEFAULT_WORKER_TASKS 1
TIBRVCOM_CM_DEFAULT_SCHEDULER_WEIGHT 1
Shared Methods
Legal Methods TibrvCmTransport.destroy
TibrvCmTransport.getName()
TibrvCmTransport.getTransport()
TibrvCmTransport.isValid()
TibrvTransport.send
TibrvTransport.sendReply
TibrvTransport.sendRequest()
When called on a distributed transport object, the disabled methods report the
error TIBRVCOM_NOT_FOR_DISTRIBUTED_TRANSPORT.
TibrvCmTransport.createDistributedQueue
Method
Remarks The new distributed queue transport must employ a valid TibrvTransport for
network communications.
Calling this method on a valid object yields the error
TIBRVCOM_ALREADY_INITIALIZED.
(Sheet 1 of 3)
Parameter Description
transport TibrvTransport
cmName String
Bind this reusable name to the new transport object, which becomes a
member of the distributed queue with this name.
The name must be non-null, and conform to the syntax rules for
Rendezvous 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.
(Sheet 2 of 3)
Parameter Description
workerWeight Long, optional
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.)
When omitted, the default value is 1.
(Sheet 3 of 3)
Parameter Description
schedulerWeight Long, optional
Weight represents the ability of this member to fulfill the role of
scheduler, relative to other members with the same name. Cooperating
members use relative scheduler weight values to elect one member as the
scheduler; members with higher scheduler weight take precedence.
When omitted, the default value is 1.
Acceptable values range from 0 to 65535. Zero is a special value,
indicating that the member can never be the scheduler. For more
information, see Rank and Weight on page 206 in TIBCO Rendezvous
Concepts.
TibrvCmTransport.getCompleteTime()
Method
Purpose Extract the worker complete time limit of a distributed queue member.
Parameter Description
completeTime Double
TibrvCmTransport.getWorkerTasks()
Method
Parameter Description
workerTasks Long
TibrvCmTransport.getWorkerWeight()
Method
Parameter Description
workerWeight Long
TibrvCmTransport.isDistributed()
Method
Parameter Description
isDistributed Boolean
TibrvCmTransport.setCompleteTime
Method
Purpose Set the worker complete time limit of a distributed queue member.
Remarks 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 time—that 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 method.
Parameter Description
completeTime Double
TibrvCmTransport.setWorkerTasks
Method
Remarks 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 weight—unless 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.
Zero is a special value, indicating that this distributed queue member is a
dedicated scheduler (that is, it never accepts tasks).
Parameter Description
workerTasks Long
TibrvCmTransport.setWorkerWeight
Method
Remarks 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 method.
Parameter Description
workerWeight Long
Chapter 11 Errors
Topics
Error Overview
VB
When VB reports an error, it populates an Err object.
VB programmers can write error handlers to process such errors. Err.Number
extracts the error status code. Err.Source identifies the object that reported the
error. Err.Description interprets the error code as a descriptive string.
• Err.Number extracts the HRESULT numeric error code.
• Err.Source identifies the object that reported the error.
• Err.Description interprets the error code as a descriptive string.
C++
C++ programs must test the HRESULT status code after each method call.
Microsoft Visual C++ defines these convenient macros:
#define FAILED(Status) ((HRESULT)(Status) <0)
#define SUCCEEDED(Status) ((HRESULT)(Status)>=0)
C++ COM programmers can use the IErrorInfo interface to extract more detail
from an object that returns an HRESULT indicating an error:
• GetErrorInfo() returns the error object.
• GetErrorSource() identifies the object that reported the error.
• GetErrorDescription() interprets the error code as a descriptive string.
Constants
The interface defines these useful constants.
Constant Description
Hex Code
TIBRVCOM_ERROR_ITF Base of all HRESULT codes from the TIBRVCOM
0x80040000 interface.
Rendezvous API error codes are 32-bit integers, with hex representations
0x80048nnn.
Constant
Description
Hex Code
TIBRVCOM_INIT_FAILURE Cannot create the network transport.
0x80048001
Constant
Hex Code Description
TIBRVCOM_INVALID_NAME The field name is too long; see Field Name Length on
0x8004801e page 46.
TIBRVCOM_INVALID_SIZE The explicit size in the field does not match its explicit
0x80048020 type.
TIBRVCOM_INVALID_COUNT The explicit field count does not match its explicit type.
0x80048021
TIBRVCOM_CONVERSION_FAILED Found the specified field, but could not convert it to the
0x80048026 desired datatype.
Constant
Hex Code Description
Constant
Hex Code Description
TIBRVCOM component error codes are 32-bit integers, with hex representations
0x80040nnn. The type library defines these error code constants.
These constants correspond to string resources—when the constant
TIBRVCOM_name has the value 0x80040nnn, the resource IDS_E_name has the value
nnn.
Constant
Description
Hex Code
TIBRVCOM_TIBRV_NOT_OPEN Operation requires that Tibrv be open.
0x80040200
Constant
Hex Code Description
Constant
Hex Code Description
VB Error Codes
Programs can receive errors that seem related to Rendezvous software, but really
originate from the VB language implementation. While it is difficult to give
complete advice to application programmers regarding these errors, Table 9
summarizes some of the common errors in this group.
Right:
’in General (Global) Declarations
dim q as TibrvQueue
’in a Subroutine
set q = tibrv.getDefaultQueue
Wrong:
’in General (Global) Declarations
dim q as New TibrvQueue
’in a Subroutine
q = tibrv.getDefaultQueue
Right:
’in General (Global) Declarations
dim q as TibrvQueue
’in a Subroutine
set q = tibrv.getDefaultQueue
Wrong:
’in General (Global) Declarations
dim q as TibrvQueue
’in a Subroutine
q = tibrv.getDefaultQueue
Index
E
embedded license 168 F
encoding
get from message 69 fault tolerance 193
get inbound default 62 action constants 208
get outbound 71 member 195
set inbound default 83 callback 207
set outbound 84 create 196
encoding, character 7 destroy 200
monitor 211
H Latin-1 7
ledger
hexidecimal string, 64-bit integer as 102 file 247
high order part of 64-bit integer 106 name, get 254
review 266
stop 273
sync 258, 274
I library files 16
licensed transport 168
identifier, field 38
inbox, create name 169
index, get by 60
R
Q
raw storage device, as ledger file 247
queue reference count 19, 25
add to group 153 reference datatypes 35
CM listener 232 references
create 136 clear 49
default 21 mark 77
destroy 137 relay agent
dispatch 138 connect to 243
fault tolerance event 203 disconnect from 251
get get from certified delivery transport 256
discard amount 140 release 5, interaction
event count 139 fields with same name 39, 66, 68
from listener 116 sequence numbers, certified delivery 236
from timer 129 release number, get 23
limit policy 141 remove
max events 142 field from message 79
name 143 queue from group 159
priority 144 removeInstance, from message 81
poll 146 removeListener, certified delivery 263
set removeSendState, certified delivery 265
limit policy 147 reply
name 148 send 177
priority 149 send certified 268
timed dispatch 150 reply subject
validity 145 get 73
set 86
request
send 178
send certified 269
request old, certified delivery 257