K+Broker Installation

greasyservantInternet and Web Development

Jul 30, 2012 (4 years and 8 months ago)

815 views




K+Broker is a tool for providing data exchange between
Thomson
-
Reuters Kondor+ TradeKast, KIS and a variety of
messaging frameworks.


K+Broker


2



Contents
Contents

................................
................................
................................
................................
........................

2

Contents

................................
................................
................................
................................
........................

2

Contents

................................
................................
................................
................................
........................

2

Installation

................................
................................
................................
................................
....................

3

Technical Requirements
................................
................................
................................
............................

3

Mandatory Applications

................................
................................
................................
........................

3

Optional Libraries

................................
................................
................................
................................
..

3

Installation

................................
................................
................................
................................
................

3

ONE JAR Installation

................................
................................
................................
..............................

4

STANDALONE Installation

................................
................................
................................
.....................

4

Description

................................
................................
................................
................................
....................

4

Configuration Files

................................
................................
................................
................................
....

5

K+ Configuration

................................
................................
................................
................................
.......

5

K+Broker Import to KIS

................................
................................
................................
.............................

6

K+Broker Export to Clients

................................
................................
................................
........................

7

Parameters for K+Broker (broker.propert
ies)

................................
................................
..........................

8

MCC Compatibility Mode

................................
................................
................................
......................

9

K+Broker Import to Clients

................................
................................
................................
.....................

10

K+Broker Websphere MQ Client

................................
................................
................................
.............

10

MQ Client Parameters
................................
................................
................................
.........................

10

K+Broker Client API

................................
................................
................................
................................
.

11

KBrokerExportClient Interface

................................
................................
................................
............

11

KBrokerImportClient Interface

................................
................................
................................
............

12


3


KBrokerImport methods

................................
................................
................................
.....................

12

Installation


Technical Requirements


Mandatory Applicat
ions



Kondor+ version 2.6 or higher



Sun Java JRE 1.5 or higher


Optional Libraries



TIBCO Rendezvous 7.x



IBM Websphere MQ 5 or higher



Sybase JCONN5.5 or higher



Oracle JDBC v8 or higher



MS SQL Server v2000 or higher



Installation

Prior to the installation K+
TradeKast and import servers must be set to RVD mode from
tradekast.params

and
kis.params

configuration file. Please consult to the Kondor+ documentation for
further instructions on how to enable tradekast and KIS to RVD mode.


ONE JAR Installation

If one
-
j
ar bundled version is to be used please only copy the tibrvj.jar file which comes with TIBCO
Rendezvous installation into the directory which you’ve copied K+Broker. After copying no other
classpath settings are required. Simply edit the parameters file ac
cording to your K+ configuration and
run the “
importadapter.sh”

for import and “
exportadapter.sh”

for export. You must also supply one
parameter as one of the following:

importadapter.sh|exportadapter.sh start|stop|status|restart


STANDALONE Installation

D
epending on which export/import system you’ll be using make sure you have the necessary jar files set
up in your classpath for the related user of the operating system you’re using.

For windows:


4


1.

Right click on “My Computer” and select properties (for Vista

click on “Advanced system
settings” on the window that shows up)

2.

Choose the “Advanced” tab and click on “Environment variables”

3.

In the “System variables” section find “CLASSPATH” and add the necessary jar files complete
location separated by semicolons. I
f there isn’t a CLASSPATH variable, simply create a new one

For Linux and Solaris:

1.

In the .cshrc or .login environment settings file include the variable CLASSPATH and set the file
paths for the related jars accordingly



5



Description

K+Broker is a middlew
are which creates a messaging infrastructure between K+ TradeKast, KIS (Kondor+
Import Server) servers and TIBCO rendezvous, or Websphere MQ, or any database with proper JDBC
drivers. K+Broker comes with a java interface API which helps the developers to w
rite their own clients.
However, K+Broker comes with two already written clients.

1.

Websphere MQ

2.

TIBCO Rendezvous



Configuration Files

There are two different configuration files for K+Broker.

1.

broker.properties: contains parameters for the export and impo
rt K+Broker

2.

MQImportClient.properties contains parameters for MQ import adapter

3.

MQExportClient.properties: contains parameters for MQ export adapter


6


All configuration files share the same syntax; <variable> = <value>.



K+ Configuration


Each K+Broker con
nects to only one codifier. New codifiers must be created in Kondor+ for export and
import individually. These codifier short names must then be filled into the configuration file as stated.
On creating codifiers please consult to the Kondor+ documentation
.

Please remember to edit the TradeKast Client Criteria in
K+ Communications

application in order to be
able to export successfully the deals and/or static data.

And it is important to set the import server codifier mode to “Automatic”.


K+Broker Import to
KIS

When transferring import data to “Kustom Window”, the following tag is required:

<TradeKast type="S">Y Yes</TradeKast>

<KPLUSFEED>

<HEADER PRIMARY="SpotDeals" OPERATION="ImportTable" ClientKey="20091218233051789111_2010
-
02
-
01
-
16.54.02.530677">

<Table t
ype="S">ImportTable</Table>

<Action type="S">I</Action>

<DealId type="I">0</DealId>

<TradeKast type="S">Y Yes</TradeKast>

<TableName type="S">SpotDeals</TableName>

</HEADER>


Kustom Window's data should be provided in <PRIMARY> tag. For instance for “TEST
” Kustom Window:

<TradeKast_TEST type="T">

<EFiyat1 type="F"> 2.126450</EFiyat1>

<EFiyat2 type="F"> 0.000000</EFiyat2>

<GFiyat1 type="F"> 2.127080</GFiyat1>

<GFiyat2 type="F"> 0.000000</GFiyat2>

<HFiyat1 type="F">

0.000000</HFiyat1>

<HFiyat2 type="F"> 0.000000</HFiyat2>

<GerceklesenMiktar1 type="F"> 1602.20</GerceklesenMiktar1>

<GerceklesenMiktar2 type="F">
-
3407.97</GerceklesenMiktar2>

</TradeKast_TEST>


When transferring import
data to “Kustom Window” and run a procedure, after <TradeKast type="S">Y
Yes</TradeKast> tag, <ExecuteCustomProcs type="S">Y Yes</ExecuteCustomProcs> tag is required:

<KPLUSFEED>

<HEADER PRIMARY="SpotDeals" OPERATION="ImportTable" ClientKey="20091218233051
789111_2010
-
02
-
01
-
16.54.02.530677">

<Table type="S">ImportTable</Table>

<Action type="S">I</Action>


7


<DealId type="I"> 0</DealId>

<TradeKast type="S">Y Yes</TradeKast>

<ExecuteCustomProcs type="S">Y Yes</ExecuteCustomProcs>

<TableName type="
S">SpotDeals</TableName>

</HEADER>

In this case, if KustomWindow has procedures running for Insert, Update ve Delete, it can run during
import.


K+Broker Export to Clients

Export from K+ via K+Broker to its clients is in real
-
time. The output of TradeKast
from K+ is in non
-
validated XML format as described in their API developer documentation. Below is a sample of K+
TradeKast xml output if “XMLParse” parameter is set to true.

<KPLUSFEED>

<HEADER>

<Action type="C">I</Action>

<DateFormat type="S">DD/MM/YYYY
hh:mm:ss</DateFormat>

<DealId type="I">100006419</DealId>

<ExportTable type="S">LoansDepositDeals</ExportTable>

<MvtDate type="D">20/11/2003 18:28:02</MvtDate>

<TransactionId type="I">73548</TransactionId>

<UsersId type="I">74269</UsersId>

<HEADER>

<PRIMAR
Y>

<TABLE name="LoansDepositDeals" rowCount="1">

<ROW rowId="100006419">

<FIELD name="LoansDepositDeals_Id" type="I">100006419</FIELD>

................

<FIELD name="LastModifDate" type="D">20/11/2003 18:27:58</FIELD>

</ROW>

</TABLE>

<TABLE name="BondsCash"

rowCount="0"/>

<TABLE name="EquitiesCash" rowCount="0"/>

<TABLE name="PapersCash" rowCount="0"/>

<TABLE name="MbsAbsCash" rowCount="0"/>

<TABLE name="LoansDepositDealsAmort" rowCount="0"/>

<TABLE name="LoansDepositCities" rowCount="2">

<ROW number="0">

<F
IELD name="LoansDepositDeals_Id" type="I">100006419</FIELD>

<FIELD name="CityFor" type="C">P</FIELD>

<FIELD name="Cities_Id" type="I">55528</FIELD>

</ROW>

<ROW number="1">

<FIELD name="LoansDepositDeals_Id" type="I">100006419</FIELD>

<FIELD name="CityFor"
type="C">R</FIELD>

<FIELD name="Cities_Id" type="I">55528</FIELD>

</ROW>

</TABLE>

<TABLE name="LoansSchedule" rowCount="15">

<ROW number="0">

<FIELD name="LoansDepositDeals_Id" type="I">100006419</FIELD>

............

<FIELD name="IsCompoundAverageRateFixed
" type="C">N</FIELD>

</ROW>

<ROW number="1">

<FIELD name="LoansDepositDeals_Id" type="I">100006419</FIELD>

................

<FIELD name="IsCompoundAverageRateFixed" type="C">N</FIELD>

</ROW>

<ROW number="2">

<FIELD name="LoansDepositDeals_Id" type="I">1000
06419</FIELD>

................


8


<FIELD name="IsCompoundAverageRateFixed" type="C">N</FIELD>

</ROW>

................

</TABLE>

</PRIMARY>

<REFERENCE>

<TABLE name="Branches" type="1">

<ROW rowId="12742">

<FIELD name="Branches_Id" type="I">12742</FIELD>

.......
.........

</ROW>

</TABLE>

<TABLE name="Cities" rowCount="1">

<ROW rowId="55528">

<FIELD name="Cities_Id" type="I">55528</FIELD>

................

</ROW>

</TABLE>

..................

</REFERENCE>

<CUSTOM>

<TABLE name="TradeKast_COD" rowCount="1">

<ROW>

<FIELD

name="field" type="I">45</FIELD>

</ROW>

</TABLE>

</CUSTOM>

</KPLUSFEED>


K+Broker Export by default exports the K+ messages as sent by the TradeKast with minor fixes in order
to complete the XML message and provide an easier transformation using XSLT or

whatever
transformation is programmed in clients.



Parameters for K+Broker (broker.properties)


The K+Broker parameters are found in three groups; TradeKast part, KIS part and Log4j part. We’ll be
describing the first two parts as Log4j is an opensource s
oftware and related documentation can be
found at
http://logging.apache.org/log4j/1.2/index.html
. Parameters are as follows:



TkService
TradeKast rvd service as stated in tradekast.params



TkNetw
ork
TradeKast rvd network as stated in tradekast.params



TkDaemon
TradeKast rvd daemon as stated in tradekast.params



TkSubject
Any subject name which must be unique to the client



TkCodifier
TradeKast codifier setup in Kondor+



TkServerPort
TradeKast port as
stated in tradekast.params



TkHost
TradeKast host as stated in tradekast.params. The host name must be computer name



TkMessagingMode
Can take values either XML, KPF, RVD, RVD_STRING



TkTransportName
Transport name for TradeKast


must be unique.



XMLParse
See

Kondor+ Export/Import documentation for details of this parameter



Synchronous
See Kondor+ Export/Import documentation for details of this parameter


9




AckAllowance
See Kondor+ Export/Import documentation for details of this parameter



XMLWrap
See Kondor+ Expo
rt/Import documentation for details of this parameter



NeverCheckUserCode
See Kondor+ Export/Import documentation for details of this parameter



SendRelevantCustomData
See Kondor+ Export/Import documentation for details of this
parameter



AutoConnect
Reconne
cts to TradeKast and KIS automatically if set to true.



AutoAck
TradeKast only; Auto Acknowledges; see Kondor+ Export/Import documentation for
details of this parameter



Timeout
K+Broker to TradeKast & KIS disconnect timeout period



MoreTkTables
TradeKast onl
y; comma separated table names for exporting. See Kondor+
Export/Import documentation for details of this parameter



KISService
KIS rvd service as stated in kis.params



KISNetwork
KIS rvd service as stated in kis.params



KISDaemon
KIS rvd service as stated
in kis.params



KISSubject
Any subject name which must be unique to the client



KISCodifier
KIS codifier setup in Kondor+



KISServerPort
KIS port as stated in kis.params



KISHost
KIS host as stated in kis.params



KISMessagingMode
Can take values either XML,

KPF, RVD, RVD_STRING



KISTransportName
Transportname for KIS


must be unique.



MCC Compatibility Mode

When this option is set to
true

the XML output is transformed into the MCC adapter’s XML output
format (header may be omitted

as is in the original):


<?
xml
version
=
"1.0"
encoding
=
"UTF
-
8"
?>

<
KPLUSFEED
>


<
HEADER
OPERATION
=
"ExportTable"
PRIMARY
=
"SpotDeals"
>



<
Action
type
=
"C"
>
I Insert
</
Action
>



<
DateFormat
type
=
"S"
>
DD/MM/YYYY hh:mm:ss
</
DateFormat
>



<
DealId
type
=
"I"
>
1258174
</
DealId
>



<
ExportTable
type
=
"U"
>
SpotDeals
</
ExportTable
>



<
MvtDate
type
=
"D"
>
01/07/2008 12:50:39
</
MvtDate
>



<
TransactionId
type
=
"I"
>
5006809
</
TransactionId
>



<
UsersId
type
=
"I"
>
1
</
UsersId
>


</
HEADER
>


<
PRIMARY
>



<
SpotDeals
type
=
"T"
>




<
Allocation
type
=
"F"
>
0.000000
</
Allocation
>




<
Amoun
t1
type
=
"F"
>
2000000.000
</
Amount1
>




<
Amount2
type
=
"F"
>
-
2460000.000
</
Amount2
>




<
AnticipatedCarryCur1
type
=
"F"
>
444.444
</
AnticipatedCarryCur1
>




<
AnticipatedCarryCur2
type
=
"F"
>
0.000
</
AnticipatedCarryCur2
>




<
BlockNumber
type
=
"I"
>
0
</
BlockNumber
>




<
Broke
rageAmount
type
=
"F"
>
0.000
</
BrokerageAmount
>




<
Brokerage_COC
type
=
"F"
>
0.000
</
Brokerage_COC
>




<
Brokers_Id
type
=
"I"
>
0
</
Brokers_Id
>




<
CaptureDate
type
=
"D"
>
01/07/2008 12:50:38
</
CaptureDate
>




<
CapturedAmount
type
=
"C"
>
1 Amount 1
</
CapturedAmount
>




<
Clear
ingModes_Id
type
=
"I"
>
0
</
ClearingModes_Id
>




<
ClientSpot
type
=
"F"
>
0.000000000
</
ClientSpot
>




<
Codifiers_Id
type
=
"I"
>
0
</
Codifiers_Id
>




<
Comments
type
=
"S"
/>


10



. . . etc . . .




K+Broker Import to Clients

There are various formats for impo
rting to K+. However, two major ways for import are MCC XML
(MXML) format and Kondor XML (K+ML) formats. Please refer to Kondor+ Export/Import
documentation for details of these formats.

Currently, K+Broker do not support database imports due to the datab
ases generic nature. However,
MQ and Rendezvous clients are available for importing with the use of XSLT transformations.

The important point to be aware of is that during import the XSL file response should be in the following
format if import format is
chosen as K+ML:

<
KPLUSFEED
>


<
ImportTable
type
=
"U"
>
SpotDeals
</
ImportTable
>


<
Action
type
=
"C"
>
I Insert
</
Action
>


<
DateFormat
type
=
"S"
>
DD/MM/YYYY hh:mm:ss
</
DateFormat
>


<
Table
type
=
"U"
>
SpotDeals
</
Table
>


<
DealStatus
type
=
"C"
>
V Valid
</
DealStatus
>


<
InputMode
type
=
"C"
>
G Generated
</
InputMode
>


<
CaptureDate
type
=
"D"
>
11/06/2008 18:08:26
</
CaptureDate
>


<
TradeDate
type
=
"D"
>
12/06/2007
</
TradeDate
>


……………………………………


And more…



For KPF and other MCC XML please refer to related documents which can be found at

Kondor+
Import/Export documentation.


K+Broker Websphere MQ Client

MQ client connects to the queue manager as specified in the parameters.



MQ Client Parameters

There are two parameter files for the MQ client one for export (
mqexportclient.properties
) oth
er for
import (mqimportclient.properties
)
.




MCCCompatible
MCC compatibility mode for input XML format



MQHostName
WebSphere MQ host



MQPort
MQ port. Usually default 1414 is used.



MQCCSID
The character encoding in IBM standard. US PC Data is usually the defau
lt 437



MQChannel
Channel name


11




MQQueueManagerName
Queue manager name



MQQueueName
Queue name



MQXSLFile
XSL file name used for transformation



Name
The name of the MQ client registering to K+Broker. Default is set as KB_MQ_IMP for
import and KB_MQ_EXP for exp
ort



JDBCDriver, JDBCUrl, JDBCUserId, JDBCPassword

Database settings.



LogToDB

If true writes log data to database.


Above parameters are common. Below ones are import only:



MQReplyQueueManagerName, MQReplyQueueName
Reply queue and it's manager's name. If
sp
ecified the reply from KIS will be written to this queue



MQErrorQueueManagerName, MQErrorQueueName

Error queue and it's manager's name. If
specified erroneous messages will be written to this queue



ReplyXSLFile
The reply will be transformed to the desired
format and then written to the queue
if specified



ImportFolder
The folder to lookup and import data from.



MessageThreshold
If set and in case of an outage the queue will be cleared if this threshold is
exceeded.

Below ones are export only:



ExportFolder
The

folder to save exported data.




12



MQImportClient Monitor

Monitor can be reach at “http://<server>:
10082
/monitor/
importer.jsp





13



MQExportClient Monitor

Monitor can be reach at “http://<server>:
10083
/monitor/
exporter.jsp




K+Broker Client API

K+Broker come
with java interfaces which developers can take advantage of itself and program their
own clients. The API consists below methods for export and import.


KBrokerExportClient Interface

public

boolean

send(String msg, String key);

This method is triggered when

data is exported from Kondor+ TradeKast. msg includes the export message and key
parameter is the clientKey if exists


public

boolean

isMccCompatible();

This is a check method used by KBrokerExport main class wether or not the export client is MCC compati
ble.


public

boolean

setExporter(KBrokerExport Exporter);

Sets the KBrokerExport object for the client to be able to use its methods.


public

boolean

setExporter(KBrokerExport Exporter) {



if

(Exporter !=
null
) {




exporter = Exporter;


14





return

true
;



}
else




return

false
;


}



public

void

onConnect();

This method is triggered when client connects to TradeKast.


public

void

onDisconnect();

This method is triggered when client disconnects from TradeKast.



KBrokerImportClient Interface

public

boolean

se
ndReply(String msg, String key,
boolean

error);

This method is triggered when a reply from Kondor+ Import Server (KIS) is received.


public

boolean

setImporter(KBrokerImport Importer);

Sets the KBrokerImport object for the client to be able to use its meth
ods. These methods will be covered later on.


public

boolean

setImporter(KBrokerImport Importer) {



if

(Importer !=
null
) {




importer = Importer;




return

true
;



}
else




return

false
;


}



public

boolean

isMccCompatible();

This is a check method use
d by KBrokerImport main class wether or not the import client is MCC compatible.


public

void

onConnect();

This method is triggered when client connects to KIS.


public

void

onDisconnect();

This method is triggered when client disconnects to KIS.



KBrokerI
mport methods


sendDealToKIS(String clientName, String xml,
long

sequenceNo, String clientKeyFromJava)

This method can be used to import data to Kondor+. sequenceNo and clientKey parameters are optional.


isConnectedToKondor()

This method checks if KBroke
rImport is connected to KIS