Configuring the Adapter : File Publisher Examples

File Publisher Examples
This section contains several configuration file examples that you can use as models for your own custom configuration file.
Example 1 Configuration File for a Delimited File
This example shows the FileType section of a configuration file for processing a delimited file.
A portion of the file shows how the data looks:
115-01-0500|MONITOR|SONY|VIEWSONIC|01|350.50
115-15-6542|CPU-PIII750MHZ|COMPAQ|PRESARIO|01|900.00
115-67-7356|HDD20GB|SEAGATE|ST500|01|276.60
115-34-8767|FDD54|HP|T24333|01|86.00
115-77-5555|CRDW|HP|T75668|01|350.00
115-78-4646|KEYBOARD|COMPAQ|EASYKEY101|01|32.00
115-88-4454|MOUSE|MICROSOFT|M323|01|26.00
115-36-2727|WINDOWS2000|MICROSOFT|MSW2000|01|400.00
 
The FileType section of the configuration file follows:
[FileType]
FILE_OPTIONS = { filePrefix="ft1",
                 useFilePolling="true", pollInterval="5000",
                 datasetType=”PDS”,
                 inputDataset=”TIBFA.TEST.IN”,
                 processDataset=”TIBFA.TEST.PROCESS”,
                 outputDataset=”TIBFA.TEST.OUT”,
                 useFieldWidth="false", delimiter="|",
                 publishSubjectName="A.B"
               }
 
MESSAGE_FIELDS = {
messageItem = { location="1", label="PartNo", type="STRING" },
messageItem = { location="2", label="Desc", type="STRING" },
messageItem = { location="3", label="Manufacturer", type="STRING" },
messageItem = { location="4", label="Model", type="STRING" },
messageItem = { location="5", label="Quantity", type="INTEGER" },
messageItem = { location="6", label="Price", type="FLOAT" },
}
Example 2 Configuration File for a Fixed-length File
This example shows the FileType section of a configuration file for processing a fixed-length file.
A portion of the file shows how the data looks
115-01-0500 MONITOR SONY VIEWSONIC 01 350.50
115-15-6542 CPU-PIII750MHZ COMPAQ PRESARIO 01 900.00
115-67-7356 HDD20GB SEAGATE ST500 01 276.60
115-34-8767 FDD54 HP T24333 01 86.00
115-77-5555 CRDW HP T75668 01 350.00
115-78-4646 KEYBOARD COMPAQ EASYKEY101 01 32.00
115-88-4454 MOUSE MICROSOFT M323 01 26.00
115-36-2727 WINDOWS2000 MICROSOFT MSW2000 01 400.00
 
The FileType section of the configuration file follows:
[FileType]
FILE_OPTIONS = { filePrefix="ft2",
                 useFilePolling="true", pollInterval="5000",
                 datasetType=”PDS”,
                 inputDataset=”TIBFA.TEST.IN”,
                 processDataset=”TIBFA.TEST.PROCESS”,
                 outputDataset=”TIBFA.TEST.OUT”,
                 useFieldWidth="true",
                 publishSubjectName="A.C"
               }
 
MESSAGE_FIELDS = {
messageItem = { position = "0", length = ”11”, label = “PartNo”,
type = "STRING" },
messageItem = { position = "11", length = ”15”, label = "Desc",
type = "STRING" },
messageItem = { position = "26", length = ”11”, label = "Manuf",
type = "STRING" },
messageItem = { position = "37", length = ”12”, label = "Model",
type = "STRING" },
messageItem = { position = 49", length = ”2”, label = "Qty",
type = "INTEGER" },
messageItem = { position = "51", length = ”6”, label = "Price",
type = "FLOAT"} }
Example 3 Accommodating Different Order Header and Order Line Formats
As an example of how to use the constraint parameter, suppose a file contains both order header and order detail records that must be combined into one output TIBCO message, but the records have different formats. You could create a TIBCO message as follows:
1.
Determine whether the record is an order header or order detail record. Do this by selecting a field from the record that contains unique data that identifies the field as a header record or as a detail record.
a.
b.
2.
3.
If the record is a header record, specify that TIBCO Rendezvous must start a new message. Do this by specifying startNewMessage=”true”. For detail records, specify startNewMessage=”false” if they are to be published with the header record as a single message. Else specify true, which causes the records to be published as separate messages.
4.
The parameter containerName is used to identify the container. For this example, the values supplied are containerName=”OrderHeader” and containerName=”OrderDetail”.
The input file containing the order header and order detail records in different formats could look like:
HDR123-234-52344
DTL34234:22343:3534534
DTL47463:34763:2734641
DTL18231:23423:1234123
HDR874-647-12331
DTL81321:46157:412564 …
The pertinent parts of the configuration file would look like:
MESSAGE_FIELDS = { constraint = { position = “0”, length = “3”, value = “HDR”,
startNewMessage = “true”,
containerName = “OrderHeader” },
messageItem = { … }
}
 
MESSAGE_FIELDS = {constraint = { position = “0”, length = “3”, value = “DTL”,
startNewMessage = “false”,
containerName = “OrderDetail” },
messageItem = { … },
messageItem = { … },
messageItem = { …}
}
Example 4 Supporting COBOL Numeric Data Types
This example shows a FilePublisher configuration file that supports the following four supported numeric data types: zoned, binary, packed, and floating point. For the FilePublisher sample configuration file, three messageItems are specified.
The FILE_OPTIONS element of the FileType section contains the parameter isBinary, specified as true.
The numeric field location is specified using the position tag in the messageItem parameter. This value specifies the byte number, starting at 1, of the starting position of the field within the record.
The precision tag in the messageItem parameter is used to identify the relative length of the field and the number of decimal positions. FilePublisher, depending on the data type, calculates the length of the field within the record. For example, if the field is identified as BINARY, and the precision is specified as 9,2, then the field occupies 4 bytes of data in the record.
When you configure COMP-1 or COMP-2 values, do not include a precision tag. This is because COMP-1 and COMP-2 fields have defined attributes, such as the length of the field and the decimal precision.
[FileType]
 
FILE_OPTIONS = { filePrefix="pack", pollInterval="1000",
useFilePolling="true", removeAfterProcess="false", messagesPerTransaction="2", isBinary="true",
messagesPerTransaction="10",transactionDelay="1000",
publishSubjectName="PACKED.DATA" }
 
MESSAGE_FIELDS = {
messageItem = { position="5", label="PackedNumeric",
precision="9,2",convertToString="true",
type="PACKED" },
messageItem = { position="10", precision="10,2",
label="ZonedNumeric", type="ZONED" },
messageItem = { position="20", label="PackedNumeric",
precision="7,0",convertToString="false",
type="BINARY" }
}
Example 5 Sample Configuration for VSAM Files
The following example lists the configuration file for publishing a KSDS VSAM file. The important flags are inputDataset, which specifies the cluster name and datasetType, which specifies that it is a VSAM file. All remaining flags are same as the SEQ file types. Various trigger messages that can be used to publish the file. are also listed.
[FileType]
 
FILE_OPTIONS = {
inputDataset = "TIBCO.KSDS.CLUSTER",
filePrefix = "FTVSAM",
dataSetType = "VSAM",
removeLeadingBlanks = "true",
removeTrailingBlanks = "true",
publishSubjectName = "A.FTVSAM",
triggerSubjectName = "TIBCO.KSDS.CLUSTER",
startPublishSubject = "START.TIBCO.KSDS.CLUSTER",
messagesPerTransaction="2",
transactionDelay="5000"
}
MESSAGE_FIELDS = {
messageItem = { fieldStart="01", label="emp_number", type="INTEGER",
length="4" },
messageItem = { fieldStart="05", label="user_id", type="STRING",
length="8" },
messageItem = { fieldStart="12", label="name", type="STRING",
length="20" },
messageItem = { fieldStart="32", label="pers_info", type="STRING",
length="37" }
}
To publish the entire file:
TIBCO.KSDS.CLUSTER
{
RVMSG_STRING 19 "DATA" "TIBCO.KSDS.CLUSTER"
}
To publish the file from a specific record until the end of the file:
TIBCO.KSDS.CLUSTER
{
RVMSG_STRING 19 "DATA" "TIBCO.KSDS.CLUSTER"
RVMSG_STRING 5 STARTKEY "5678"
}
To publish the file from a specific record to a specific record:
TIBCO.KSDS.CLUSTER
{
RVMSG_STRING 19 "DATA" "TIBCO.KSDS.CLUSTER"
RVMSG_STRING 5 STARTKEY "5678"
RVMSG_STRING 5 ENDKEY "5679"
}
To publish the file using the RBA keys starting from the 5th record to 10th record (the record length of the cluster is 70):
TIBCO.KSDS.CLUSTER
{
RVMSG_STRING 19 "DATA" "TIBCO.KSDS.CLUSTER"
RVMSG_STRING 4 STARTKEY "280"
RVMSG_STRING 4 ENDKEY "630"
RVMSG_STRING 2 ISRBARRN "1"
}
Example 6 Sample Configuration for VSAM Files Using the Alternative Key
This configuration is for publishing the KSDS VSAM file using the alternate key. To do this, inputDataset has the PATH name.
[FileType]
FILE_OPTIONS = {
                 inputDataset = "TIBCO.TFA.KSDS.CLUSTER.UPATH",
                 vsamAltIndex=" TIBCO.TFA.KSDS.CLUSTER.UPATH",
                 vsamAltIndex=" TIBCO.TFA.KSDS.CLUSTER.NUPATH",
filePrefix = "FTVSAM",
dataSetType = "VSAM",
removeLeadingBlanks = "true",
removeTrailingBlanks = "true",
publishSubjectName = "A.FTVSAM",
triggerSubjectName = "TIBCO.TFA.KSDS.CLUSTER",
startPublishSubject = "START.TIBCO.TFA.KSDS.CLUSTER",
messagesPerTransaction="2",
transactionDelay="5000"
}
MESSAGE_FIELDS = {
messageItem = { fieldStart="01", label="emp_number", type="INTEGER",
length="4" },
messageItem = { fieldStart="05", label="user_id", type="STRING",
length="8" },
messageItem = { fieldStart="12", label="name", type="STRING",
length="20" },
messageItem = { fieldStart="32", label="pers_info", type="STRING",
length="37" }
}
To publish the contents of the KSDS file using the AltIndex starting with binary integer keys 1234 and ending at key 5678:
 
   TIBCO.TFA.KSDS.CLUSTER
    {
    RVMSG_STRING 25 DATA "TIBCO.TFA.KSDS.CLUSTER.UPATH "
    RVMSG_STRING 5 HEXSTARTKEY "F1F2F3F4"
    RVMSG_STRING 5 HEXENDKEY "F5F6F7F8"
    }
Following are trigger messages for publishing the files. To publish the contents of the ESDS file starting with RBA 1020 and continuing for a maximum of 20 records:
 
TIBCO.SAMPLE2
{
RVMSG_STRING 18 DATA "TIBCO.TFA.ESDS.SAMPLE2"
RVMSG_STRING 4 STARTKEY "1020"
RVMSG_STRING 1 ISRBARRN "1"
RVMSG_STRING 2 MAXRECORDS "20"
}
To publish the contents of the RRDS file starting with RRN 100 and continuing for a maximum of 10 records:
 
TIBCO.SAMPLE3
{
RVMSG_STRING 18 DATA "TIBCO.TFA.RRDS.SAMPLE3"
RVMSG_STRING 4 STARTKEY "100"
RVMSG_STRING 1 ISRBARRN "1"
   RVMSG_STRING 2 MAXRECORDS "10"
    }
Example 7 Sample Configuration for using ECM with ECMSubscriberName
This configuration is for publishing a file using ECM with __TIBCO_AE_ADAPTER_FAFT_*.<subject name> administrative messages handshake.
[FileType]
FILE_OPTIONS = {filePrefix = "PB026",
dataSetType = "SEQ",
useFilePolling = "false",
useExplicitConfirmation = "true",
publishSubjectName = "A.FT11",
triggerSubjectName = "TRIG.PUB018",
ECMSubscriberName = "SUB1",
ECMSubscriberName = "SUB2",
blockTransferMode = "true",
messagesPerTransaction = "3",
transactionDelay = "5000",
retransmissionDelayTicks = "10",
noWaitAfterConfirmation = "true",
isBinary = "true",
endPublishSubject = "END.BLOCK_TRANSFER.FILE"
}
 
Example 8 Configuration for EMS
 
[Trace]
FILE_NAME = "KISHORE.TEST.LOG"
FILE_COUNT = "5"
FILE_LIMIT = "10000"
TRACE_LEVEL = 3
PRINT_STDOUT = "true"
[Options]
EMS_SESSION = { providerURL="tcp://<EMSserver_address:Port>",
user = "", password = "" }
INPUT_DATASET = "KISHORE.FT11.INPDS"
PROCESS_DATASET = "KISHORE.FT11.PRSPDS"
ERROR_DESTINATION = "ERROR.PUB003"
OUTPUT_DATASET = "KISHORE.FT11.OUTPDS"
ADAPTER_NAME = "PUB003"
PUBLISH_HEARTBEAT = "true"
HEARTBEAT_TIME = "30000"
 EPM_DESTINATION = "A.EMSP001"
HOST_CODEPAGE = "IBM-1047"
NETWORK_CODEPAGE = "UTF-8"
[FileType]
FILE_OPTIONS = {
filePrefix = "FT11",
pollInterval = "30000",
useFilePolling = "false",
startAtLine = "1",
messagesPerTransaction = "2",
delimiter = "|",
publishDestinationName = "A.FT11",
publishDestinationType = "TOPIC",
deliveryMode = "non-persistent",
startPublishDestinationName = "A.FT11.START",
endPublishDestinationName = "A.FT11.END",
JMS_TIBCO_MSG_TRACE = "body",
transactionDelay = "1000",
dataSetType = "PDS",
triggerDestinationName = "PUB003.TRIG.FT11",
triggerDestinationType = "QUEUE",
removeLeadingBlanks = "false",
removeTrailingBlanks = "true",
inputDataset = "KISHORE.FT11.INPDS",
processDataset = "KISHORE.FT11.PRSPDS",
outputDataset = "KISHORE.FT11.OUTPDS"
}
MESSAGE_FIELDS = {
messageItem = { location="1", label="Label1", type="STRING" },
messageItem = { location="2", label="Label2",
type="STRING" },
messageItem = {
location="3", label="Label3",
type="STRING"
},
messageItem = {
location="4", label="Label4",
type="STRING"
},
messageItem = {
location="0", label="Label5", constant="true",
type="STRING", value="04"
},
messageItem = {
location="6", label="Label6",
type="FLOAT"
},
messageItem = { location="0", label="TimeStamp", type="TIME",
constant="true", value="TimeStamp" }
}
Example 9 Sample Configuration for Multiple File Types in a single Config file
This configuration demonstrates how multiple File Types can be defined in a single config file. Up to a maximum of 512 File Types can be defined in a single config file. A single config file can contain any combination of record mode, block mode, VSAM, SEQ, or PDS files.
[Trace]
FILE_NAME = "DUQAINE.TEST.LOG"
FILE_COUNT = "5"
FILE_LIMIT = "10000"
TRACE_LEVEL = 3
PRINT_STDOUT = "true"
TZ="EST5EDT"
 
[Options]
RV_SESSION = { name="FilePublisher_01",
service = "", network = "", daemon = "" }
INPUT_DATASET = "DUQAINE.FT11.INPDS"
PROCESS_DATASET = "DUQAINE.FT11.PRSPDS"
ERROR_SUBJECT = "ERROR.PUB001"
OUTPUT_DATASET = "DUQAINE.FT11.OUTPDS"
ADAPTER_NAME = "PUB003"
PUBLISH_HEARTBEAT = "true"
HEARTBEAT_TIME = "30000"
EPM_SUBJECT = "A.RVPUB001"
HOST_CODEPAGE = "IBM-1047"
NETWORK_CODEPAGE = "UTF-8"
[FileType]
FILE_OPTIONS = {
inputDataset = "TIBCO.TFA.KSDS.CLUSTER.UPATH",
vsamAltIndex=" TIBCO.TFA.KSDS.CLUSTER.UPATH",
vsamAltIndex=" TIBCO.TFA.KSDS.CLUSTER.NUPATH",
filePrefix = "FTVSAM",
dataSetType = "VSAM",
removeLeadingBlanks = "true",
removeTrailingBlanks = "true",
publishSubjectName = "A.FTVSAM",
triggerSubjectName = "TIBCO.TFA.KSDS.CLUSTER",
startPublishSubject = "START.TIBCO.TFA.KSDS.CLUSTER",
messagesPerTransaction="2",
transactionDelay="5000"
}
MESSAGE_FIELDS = {
messageItem = { fieldStart="01", label="emp_number", type="INTEGER",
length="4" },
messageItem = { fieldStart="05", label="user_id", type="STRING",
length="8" },
messageItem = { fieldStart="12", label="name", type="STRING",
length="20" },
messageItem = { fieldStart="32", label="pers_info", type="STRING",
length="37" }
}
[FileType]
FILE_OPTIONS = {filePrefix = "PB026",
dataSetType = "SEQ",
useFilePolling = "false",
useExplicitConfirmation = "true",
publishSubjectName = "A.FT11",
triggerSubjectName = "TRIG.PUB018",
ECMSubscriberName = "SUB1",
ECMSubscriberName = "SUB2",
blockTransferMode = "true",
messagesPerTransaction = "3",
transactionDelay = "5000",
retransmissionDelayTicks = "10",
noWaitAfterConfirmation = "true",
isBinary = "true",
endPublishSubject = "END.BLOCK_TRANSFER.FILE"
}
 
[FileType]
FILE_OPTIONS = { filePrefix="ft1",
useFilePolling="true", pollInterval="5000",
datasetType="PDS",
inputDataset="TIBFA.TEST.IN",
processDataset="TIBFA.TEST.PROCESS",
outputDataset="TIBFA.TEST.OUT",
useFieldWidth="false", delimiter="|",
publishSubjectName="A.B"
}
MESSAGE_FIELDS = {
messageItem = { location="1", label="PartNo", type="STRING" },
messageItem = { location="2", label="Desc", type="STRING" },
messageItem = { location="3", label="Manufacturer", type="STRING" },
messageItem = { location="4", label="Model", type="STRING" },
messageItem = { location="5", label="Quantity", type="INTEGER" },
messageItem = { location="6", label="Price", type="FLOAT" },
}
 
Example 10 Nesting of Mapped Messages
When nesting map messages, child messages are nested inside a stream message. This allows the nested map messages to be retrieved in the order in which they were inserted from inside the stream message without extra effort. In addition, at each transaction boundary, each map message will identify itself with an internal name-value pair generated by the FilePublisher. This internal name-value pair appears as follows:
aXxXCONSTRAINTXxXa={String:dytsth}
where dytsth is the name defined for the container name in the CONSTRAINT.
Sample MESSAGE_FIELDS definitions:
 
MESSAGE_FIELDS = { CONSTRAINT = {POSITION = "0", length = "1",
                   value = "H", startnewmessage = "true",
                   containername = "dytsth" } ,
   MESSAGEITEM = { position="0", length = "1",
                   label="hdrRec", type="STRING" },
   MESSAGEITEM = { position="1", length = "11",
                   label="hPartNo", type="STRING" },
   MESSAGEITEM = { position="12",length = "15",
                   label="hDesc", type="STRING" },
   MESSAGEITEM = { position="27",length = "11",
                   label="hManufacturer", type="STRING" },
   MESSAGEITEM = { position="38",length = "12",
                   label="hModel", type="STRING" } }
MESSAGE_FIELDS = { CONSTRAINT = {POSITION = "0", length = "1",
                   value = "D", startnewmessage = "false",
                   containername = "dytstd" } ,
   MESSAGEITEM = { position="0", length = "1",
                   label="dtlRec", type="STRING" },
   MESSAGEITEM = { position="1", length = "11",
                   label="PartNo", type="STRING" },
   MESSAGEITEM = { position="12",length = "15",
                   label="Desc", type="STRING" },
   MESSAGEITEM = { position="27",length = "11",
                   label="Manufacturer", type="STRING" },
   MESSAGEITEM = { position="38",length = "12",
                   label="Model", type="STRING" }
   }
 
Sample input data file:
 
Hpartnumber1description1111manufact111modelnum1111
Dpartnumber1description1111manufact111modelnum1111
Hpartnumber2description2222manufact222modelnum2222
Dpartnumber2descriptionXXXXmanufact222modelnum2222
Dpartnumber2description2222manufact222modelnum2222
Hpartnumber3description3333manufact333modelnum3333
Dpartnumber3description3333manufact333modelnum3333
The following four messages would be generated and sent by the FilePublisher:
StreamMessage={ Header={ JMSMessageID={ID:EMS-SERVER.7B84B0D3513102:25} JMSDestination={Queue[DY.MRECFM.FILE.BACKUP]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Dec 03 10:03:43 EST 2009} JMSExpiration={0} JMSPriority={4} } Properties={ JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={ {MapMsg:{ hDesc={String:description1111} hModel={String:modelnum1111} aXxXCONSTRAINTXxXa={String:dytsth} hPartNo={String:partnumber1} hManufacturer={String:manufact111} hdrRec={String:H} }} {MapMsg:{ Manufacturer={String:manufact111} Model={String:modelnum1111} aXxXCONSTRAINTXxXa={String:dytstd} PartNo={String:partnumber1} dtlRec={String:D} Desc={String:description1111} }} } }
StreamMessage={ Header={ JMSMessageID={ID:EMS-SERVER.7B84B0D3513102:26} JMSDestination={Queue[DY.MRECFM.FILE.BACKUP]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Dec 03 10:03:44 EST 2009} JMSExpiration={0} JMSPriority={4} } Properties={ JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={ {MapMsg:{ hDesc={String:description2222} hModel={String:modelnum2222} aXxXCONSTRAINTXxXa={String:dytsth} hPartNo={String:partnumber2} hManufacturer={String:manufact222} hdrRec={String:H} }} {MapMsg:{ Manufacturer={String:manufact222} Model={String:modelnum2222} aXxXCONSTRAINTXxXa={String:dytstd} PartNo={String:partnumber2} dtlRec={String:D} Desc={String:descriptionXXXX} }} {MapMsg:{ Manufacturer={String:manufact222} Model={String:modelnum2222} aXxXCONSTRAINTXxXa={String:dytstd} PartNo={String:partnumber2} dtlRec={String:D} Desc={String:description2222} }} } }
StreamMessage={ Header={ JMSMessageID={ID:EMS-SERVER.7B84B0D3513102:27} JMSDestination={Queue[DY.MRECFM.FILE.BACKUP]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Dec 03 10:03:44 EST 2009} JMSExpiration={0} JMSPriority={4} } Properties={ JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={ {MapMsg:{ hDesc={String:description3333} hModel={String:modelnum3333} aXxXCONSTRAINTXxXa={String:dytsth} hPartNo={String:partnumber3} hManufacturer={String:manufact333} hdrRec={String:H} }} {MapMsg:{ Manufacturer={String:manufact333} Model={String:modelnum3333} aXxXCONSTRAINTXxXa={String:dytstd} PartNo={String:partnumber3} dtlRec={String:D} Desc={String:description3333} }} } }
MapMessage={ Header={ JMSMessageID={ID:EMS-SERVER.7B84B0D3513102:28} JMSDestination={Queue[DY.MRECFM.FILE.BACKUP]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Dec 03 10:03:44 EST 2009} JMSExpiration={0} JMSPriority={4} } Properties={ } Fields={ HOSTNAME={String:IBMI-V5R4.NA.TIBCO.COM} RecordNumber={Integer:0} filename={String:DY2A} eof={Boolean:true} numofretries={Integer:1} NumberOfMessages={Integer:3} trackingid={String:Kq2@@D@@GlPVoE@56azzxkDkzzw} version={String:5.0} USERID={String:} } }