sb-trading-components-admin
Trading Components Administration Utility — Starts the StreamBase Trading Components administration client
DESCRIPTION
The sb-trading-components-admin command starts the StreamBase Administration Client for Trading Components, which lets you identify all instances of handlers running on a network and sends commands to one or all handlers using JSON over UDP. The tool lets you interactively subscribe to, unsubscribe from, and ping venues, to list current connections and subscriptions, and other tasks.
Prerequisites
Each handler must be set up with its own TCP and UDP ports which communicate back with the tool. It finds the handlers using a standard UDP ping port which all handlers and the tool share. The default UDP port is 9000 and the default multicast address is 239.0.0.0.
Connections, also called destinations, are identified by a host IP address and a port ID number. For convenience, instead of always providing these two parameters to commands that require them, connections have sequentially assigned reference numbers. Typing listconnections will generate a list of current connections, with each entry prefaced by its reference number.
OPTIONS
When used, the following options must be given in the order listed below.
-
-h
ip
-
The IP address of a connected venue being referenced. Not needed if
-r
is specified. When used, also requires port ID to be specified. -
-p
id
-
The port number for a connected venue being referenced. Not needed if
-r
is specified. When used, also requires host IP address to be specified. -
-r
destination
-
An 0-based integer destination ID for a venue being referenced. Not needed if
-h
and-p
are both specified. Use listconnections to obtain destination IDs. -
-a
string
-
One or more arguments providing data appropriate to the command. The number and meaning of arguments varies among the commands. You should not repeat
-a
if providing more than one argument. The arguments themselves should not have quotes around them. -
-f
string
-
A text file name to which the command output is written. Not all commands can write to a file. Some commands generate file names that include host and port identifiers followed by the string entered. Any existing file with the same name is overwritten. See the config command for more information about how the program constructs such filenames.
COMMANDS
-
bounce [-h
ip
-pid
| -rrefnum
-aFIX_ID
SENDER_ID
TARGET_ID
], b [-hip
-pid
| -rrefnum
-aFIX_ID
SENDER_ID
TARGET_ID
] -
Disconnect from venue and then reconnect. Takes either 0 or 3 arguments. With no arguments, only one venue must be connected; if the FX adapter has multiple FX sessions, it will fail. The three arguments used to identify a session are
(FIX tag 8),BeginString
(FIX tag 49), andSenderCompID
(FIX tag 56). Bouncing a FX session does not reset destination numbers.TargetCompID
Example:
bounce -r 0 -a FIX.4.4 SENDER_ID TARGET_ID
Attempts to bounce the FX session specified by these parameters on the handler at connection 0. No output is returned if the operation succeeds, but you are notified if a valid connection is not specified.
-
config -h
ip
-pid
| -rrefnum
[-ffilename
] , cfg -hip
-pid
| -rrefnum
[-ffilename]
-
Prints configuration key, value pairs in configuration file format for connection described by a refnum or host and port. Use
-f
to pipe command output to a file, which can then be used as a configuration file. Returns a list of paths to log files for the FX Adapter for connection at portid
at hostip
. For example,config -h 10.97.12.333 -p 11111 -f test.log
would create a file called
10.97.12.233_11111_test.log
, in which the host and port identifiers are separated with an underscore, followed by an underscore and the given file name. -
handlers
,hs
-
Takes no arguments and returns the handler status, version info and the venue name.
Example:
hs
Possible response:
Printing all current connections: --------------------------------- [0] : FXSpotStream Market Data [10.181.1.189:11109] [1] : Deutsche Bank AutobahnFX Rapid FIX Market Data [10.181.1.189:11107] ---------------------------------
-
help
,help
,command
help dest
,help args
-
Provides help about commands, options and arguments.
Example:
help
Response:
For more info on any of these commands, Type 'help [command]' Type 'help dest' for information on the [-h -p || -r] arguments Type 'help args' for information on the [-a args...] [-f [filename]] Client Usage: cmd [-h [host] -p [port] || -r [ref#]] [-a args...] [-f [filename]] The list of local commands is: help (h) quit (q) listconnections (lc) ping (p) The list of administration commands is: handlers (hs) subscriptions (subs) snapshot (snap) logs (l) config (cfg) subscribe (sub) unsubscribe (unsub) bounce (b)
- listconnections, lc
-
Prints a list of all active connections to SB FX Servers, including: Local Reference Number, IP Address and Ports. Supply the reference numbers returned from this command to the config, logs,snapshot, bounce, and unsubscribe commands with the
-r
option (or the-h
and-p
options). Without those options, those commands act on all current subscriptionsExample:
lc
Possible response:
Printing all current connections: --------------------------------- [0] : Deutsche Bank AutobahnFX Rapid FIX Market Data [10.97.233.40:11107] [1] : FXSpotStream Market Data [10.97.233.40:11109] ---------------------------------
The numbers returned in the first column are destination references, and can be used to identify connections with the
-r
option. -
logs -h
ip
-pid
| -rrefnum
, l -hip
-pid
| -rrefnum
-
Returns a list of paths to log files for the FX Adapter for connection at destination
refnum
or portid
at hostip
. For example,logs -h 10.97.12.333 -p 11111
or
(wherelogs -r 0
-r 0
refers to the above connection)returns a list of paths to log files for that FX adapter connection.
- ping, p
-
Causes the client to 'ping' the multicast group to update the connection list with any new FX servers and remove dead connections. This command is automatically called by the client every 5 seconds, and can also be issued manually (without affecting the periodic pinging).
The ping command produces no output. Use listconnections to identify current group members.
- quit, q
-
Exits the sb-trading-components-admin utility, asking for confirmation first. You can also type Ctrl+C to exit immediately.
-
snapshot -h
ip
-pid
| -rrefnum
-asubscription
, snap hostip
-pid
| -rrefnum
-asubscription
-
Takes a reference number or a host/port pair and one
-a
argument, the Subscription ID, for which to take a snapshot. Requires the option and that argument. Obtain subscription IDs with the listconnections command. Thus snapshot -r 0 Is an invalid command, since it doesn't provide the requisite subscriptionID.Example:
snapshot -r 0 -a R-1-1403640896972
Retrieves a snapshot of the subscription with subscriptionID R-1-1403640896972, such as the following response:
#Response from: FXSpotStream [10.181.1.189:11109] # Operation SUCCEEDED # Message: # Snapshot query returned 2 quotes [0]: Subscription ID: R-1-1403640896972 MsgSeqNum: 10 Instrument: Instrument Type: SPOT Currency 1: EUR Currency 2: USD Settlement Date: Settlement Date Far: Tenor: Tenor Far: Venue Name: FXSpotStream Quote ID: Q-5-1403640896991MSB Side: BID Type: 0 Currency: EUR Price: 1.06313278101711 Quantity: 1000.0 Quantity Far:Takes no arguments and returns the handler status, version info and the venue name. Spot Rate: Forward Points: Forward Points Far: Settlement Date: 2014-04-08 00:00:00.000-0400 Settlement Date Far: Venue Time: 2014-06-23 15:14:56.991-0400 Arrival Time: 2014-06-24 16:15:03.032-0400 Adapter Nanos: 84808790043067 Handler Nanos: 84808792671833 Extended Field 1: MS [1]: Subscription ID: R-1-1403640896972 MsgSeqNum: 10 Instrument: Instrument Type: SPOT Currency 1: EUR Currency 2: USD Settlement Date: Settlement Date Far: Tenor: Tenor Far: Venue Name: FXSpotStream Quote ID: Q-4-1403640896991GSA Side: ASK Type: 1 Currency: EUR Price: 1.07322807638671 Quantity: 1000000.0 Quantity Far: Spot Rate: Forward Points: Forward Points Far: Settlement Date: 2014-04-08 00:00:00.000-0400 Settlement Date Far: Venue Time: 2014-06-23 15:14:56.991-0400 Arrival Time: 2014-06-24 16:15:03.032-0400 Adapter Nanos: 84808790043067 Handler Nanos: 84808792671833 Extended Field 1: GS
Note that
snapshot -r 0
Is an invalid command, as it does not provide the requisite subscriptionID. -
subscribe -h
ip
-pid
| -rrefnum
-aargs
, sub -hip
-pid
| -rrefnum
-aargs
-
Interactively subscribes to a venue, specifying the same 13 fields as the initial subscription file. It returns a status and message, which reports only on the success or failure of the submission of the command. If the handler rejects the request, it will not be reported by this response.
All 13 arguments must be provided in the following order:
-
InstrumentType
-
Currency1
-
Currency2
-
SettlementDate
-
SettlementDateFar
-
Tenor
-
TenorFar
-
Side
-
MarketDepth
-
Quantity
-
QuantityFar
-
Duration
-
Currency
Expects all 13 values. Use
null
in place of any values which you do not want to specify.Example:
subscribe -r 0 -a SPOT EUR USD null null null null null 0 null null null null
Possible response:
#Response from: FXSpotStream [10.181.1.189:11109] # Operation SUCCEEDED # Message: # Sent SUBSCRIBE R-1-1403702057539 request to handler
-
-
subscriptions -h
,ip
-pid
| -rrefnum
[-a cur1 [cur2]]subs -h
ip
-pid
| -rrefnum
[-a cur1 [cur2]] -
Lists subscriptions to FX venues. Takes 0 to 2 arguments:
-
With no arguments, it returns all active subscriptions.
-
With 1, it filters subscriptions by their Currency value.
-
With 2, filters subscriptions by their Instrument's currency pair.
Examples:
subs
Sends a request to list all active subscriptions
subs -a USA
Sends a request to list all subscriptions whose Currency1 or Currency2 value is 'USA'
subs -a USA EUR
Sends a request to list all subscriptions whose Instrument's Currency1 and Currency2 values are 'USA' and 'EUR' (order is irrelevant). Possible response:
#Response from: FXSpotStream [10.181.1.189:11109] # Operation SUCCEEDED # Message: # Subscription query returned 1 subscriptions [0]: Subscription ID: R-1-1403640896972 MD Req ID: R-1-1403640896972 Instrument: Instrument Type: SPOT Currency 1: EUR Currency 2: USD Settlement Date: Settlement Date Far: Tenor: Tenor Far: Side: BOTH Market Depth: 0 Quantity: Quantity Far: Currency: Duration: Expiration: Pending Unsubscribe Timeout:
-
-
unsubscribe -h
ip
-pid
| -rrefnum
-asubscriptionID
, unsub -hip
-pid
| -rrefnum
-asubscriptionID
-
Unsubscribes from a venue. Takes one required argument, the subscription ID to unsubscribe from. Returns a status and a message reporting if its submission was successful. The response does not indicate if the handler rejected the request. Use the subscriptions command to verify outcomes.
Example:
unsubscribe -r 0 -a R-1-1372341719901
Sends an unsubscribe command for the subscription whose
subscriptionID
is R-1-1372341719901. Possible response:#Response from: FXSpotStream [10.181.1.189:11109] # Operation SUCCEEDED # Message: # Sent UNSUBSCRIBE R-1-1372341719901 request to handler
Note that
unsubscribe -r 0 -a
is an invalid command, as it does not provide the requisite subscriptionID.
FILES
There is no configuration file for sb-trading-components-admin. You can use the
-f
option to send to a file the output of any command
that returns information about a connection. New files having the same name as
existing files overwrite them.
COMMUNICATION PARAMETERS
The sb-trading-components-admin tool uses these parameters to communicate with running handlers:
- TCPPort
-
(String) — The TCP port used to communicate back to the FX admin client tool
- UDPListenPort
-
(int) — The UDP port used to listen for ping requests to enable the FX admin client tool to find all the handlers
- UDPWritePort
-
(int) — The UDP port used to write back the ping response to enable the FX admin client tool to find all the handlers
- MulticastIP
-
(String) — The multicast address used to communicate with the FX admin client tool
- AdminModule
-
(String, "Enabled" or "Disabled") — Determines whether the venue handler opens the socket connections required by the FX admin client tool.
These values are appropriately defaulted by all the handlers. Each venue handler must have a unique TCPPort and UDPWritePort. StreamBase Studio automatically assigns a unique port number to each handler instance it creates. However, should more than one instance of a handler exist on a network, users must make sure that their port numbers are unique. To override any of the above parameters, open the Parameters tab of the handler and add the name of the parameter and the value you want to set it to.
DATA FORMAT
The FX admin client tool uses JSON expressions to communicate directly with the venue handlers. For example, if you use it to subscribe to a venue, it outputs a request like this (line break added for readability):
{"args":["SPOT","EUR","USD","null","null","null","null","null","0","null","null","null","null"], "method":"subscribe","requestID":"2e7550b9-a2a6-42b1-a1cb-3d107881ea85"}
The JSON response to such a request might be:
{"requestID":"2e7550b9-a2a6-42b1-a1cb-3d107881ea85", "methodSuccess":{"success":true,"message":"Sent SUBSCRIBE R-1-1403881738107 request to handler"}}
Commands that print such responses to the screen format them, and do not issue JSON strings to the terminal window.
The JSON protocols could be implemented in a Web page or a LiveView application having capabilities similar to those of the sb-trading-components-admin tool to monitor and control venue handlers through a more convenient user interface.