Copyright © TIBCO Software Inc. All rights reserved
Copyright © TIBCO Software Inc. All rights reserved


Chapter 4 Using the Adapter : FilePublisher Usage Guidelines

FilePublisher Usage Guidelines
This section provides some guidelines for using FilePublisher and explains special configuration options. In includes the following information:
Sending Numeric Data Types
This section explains how FilePublisher can be configured to handle the numeric data types supported by the adapter.
You can configure FilePublisher to publish non-text files by using the isBinary=true parameter and the messageItem parameter tags in the FileType section. When transmitted to a Subscriber, numeric data types are converted to FLOAT, STRING or INTEGER TIBCO data types.
When you configure one of these data types, you use the “type” tag to identify the type of numeric field. To specify a binary decimal field, you can specify type=binary” or type=COMP” or type=COMP-4”. To specify packed decimal, you can specify type=PACKED” or type=COMP-3”.
Floating-point numeric fields are specified as either COMP-1 or COMP-2. COMP-1 indicates that the input field is a 4 byte long floating point number. COMP-2 indicates that the input field is an 8 byte long floating point number.
Since there can be a loss of precision when converting to FLOAT from non-float values, it might be preferable to specify STRING as the published data type.
See Sample Configuration Elements for an example of a FilePublisher configuration file that handles the supported numeric data types.
Sending Data Untranslated (OPAQUE)
You can configure the adapter to publish a field without translating the data within the field. Usually, when FilePublisher reads a record from a file, it translates the data within each field to TIBCO Rendezvous “wire format,” which is then published. When FileSubscriber receives the published message, it converts the “wire format” message to the appropriate data type for the platform that it is on.
If it is necessary to publish binary data other than the supported COBOL numeric data types, from one platform to another platform that supports the same data types (such as from one EBCDIC machine to another EBCDIC machine), you can specify OPAQUE for the data type. When you do this, the data in the field is published “as is,” with no conversion. When FileSubscriber receives the OPAQUE TIBCO Rendezvous message, it writes the data in that field to the field “as is.”
To support zoned, binary, packed, floating-point, and opaque data types:
1.
Set the isBinary parameter in the FILE_OPTIONS element to true.
2.
Set the type tag in the messageItem parameter to the desired value.
Constructing a Subject Name from Data
Data from a file is normally published with a predefined subject name. However, if the subject name is not constant for all the lines of data in a file, and if the subject depends on a certain data field from the input file, specify a valid node within angle brackets (< >). A valid node is a label of a defined messageItem parameter prefixed by its container name separated by a period.
For example:
publishSubjectName = “CHECK.JAN.<ChKey.RoutingCode>.CLEARED”
uses data of the label RoutingCode in the container name ChKey to construct the publishSubjectName. That is, if the value of RoutingCode in the message to publish is 154363, the publishSubjectName for publishing, that message is CHECK.JAN.154363.CLEARED.
The configuration file coding necessary in this example would be as follows:
[FileType]
FILE_OPTIONS={…
PublishSubjectName=”CHECK.JAN.<ChKey.RoutingCode>.CLEARED”,
}
MESSAGE_FIELDS={
messageContainer={name=”ChKey”,
messageItem={position=”0”,length=”6”,
Label=”RoutingCode”, type=”STRING”},
messageItem={ … },
messageItem={ … },
 
Publishing Double Values
­FilePublisher supports publishing of floating point numbers in three ways:
The adapter defaults to 6-digit precision for these values.
Pre-registering Subscribers
You can configure FilePublisher to specify a list of anticipated subscribers for the subjects it is publishing. By pre-registering the anticipated subscribers, the delivery of certified messages is guaranteed even if FileSubscribers start before or after the configured FilePublisher or even if a FileSubscriber is stopped and restarted later. To use this feature, both FilePublisher and FileSubscriber have to establish RVCM sessions with the requireOldMessages parameter set to true. To implement the pre-registering of subscribers, include this section in the FilePublisher configuration file:
[Pre-Register]
SUBSCRIBER = { listenerName = "<name of the subscribing session>",
               listeningSubject = "<name of the subject subscribed for>" },
SUBSCRIBER = { listenerName = "<name of the subscribing session>",
               listeningSubject = "<name of the subject subscribed for>" }
……
Currently, the maximum number of subscribers that can be pre-registered is 126.
 

Copyright © TIBCO Software Inc. All rights reserved
Copyright © TIBCO Software Inc. All rights reserved