Page tree
Skip to end of metadata
Go to start of metadata

Monitoring and management using a remote shell

Introduction

FIX Edge Java includes an interactive shell that you can use to start, stop and query fix server and sessions. There are also useful commands to monitor JVM. In this section we will introduce the main commands and features of the shell.

Connecting to the remote shell

Connection is done on port 2000.

Linux and OSX users can use ssh to connect to the remote shell, Windows users can download and install PuTTY.

$ ssh -p 2000 user@localhost
Password authentication
Password:
 ________  _____  ____  ____  ________  ______      ______  ________        _____     _  ____   ____  _
|_   __  ||_   _||_  _||_  _||_   __  ||_   _ `.  .' ___  ||_   __  |      |_   _|   / \|_  _| |_  _|/ \
  | |_ \_|  | |    \ \  / /    | |_ \_|  | | `. \/ .'   \_|  | |_ \_|        | |    / _ \ \ \   / / / _ \
  |  _|     | |     > `' <     |  _| _   | |  | || |   ____  |  _| _     _   | |   / ___ \ \ \ / / / ___ \
 _| |_     _| |_  _/ /'`\ \_  _| |__/ | _| |_.' /\ `.___]  |_| |__/ | _ | |__' | _/ /   \ \_\ ' /_/ /   \ \_
|_____|   |_____||____||____||________||______.'  `._____.'|________|(_)`.____.'|____| |____|\_/|____| |____|

Welcome to Dzmitry + !
It is Sun Oct 11 05:15:22 BRT 2015 now

The bye command disconnect from the shell.

% bye
Have a good day!

Connection to localhost closed.

Remote shell credentials

Shell uses a Spring Security to handle login duties. See Security configuration.

Remote shell commands

Administrative shell provide an environment with a set of specific commands after establishing connection.

Cluster management

Usage:

% cluster [-h | --help] COMMAND [ARGS]

The most commonly used cluster commands are:

  • stop - stop node with the given id.

% cluster stop FixEdgeJ1
Node with id [-1062725718] has stopped
  • info - show node info.
% cluster info FixEdgeJ1
name      leader id          address             local
-------------------------------------------------------
FixEdgeJ1 true   -1062725718 /192.168.1.100:5701 true
  • nodes - list of cluster nodes.
% cluster nodes
Id             Name          Local          Leader          Address
--------------------------------------------------------------------------------
-1062725718    FixEdgeJ1     this           this            /192.168.1.100:5701
-1062725719    FixEdgeJ2                                    /192.168.1.101:5701
  • health - show status on the health of the cluster.
% cluster health
clusterName status numberOfNodes
---------------------------------
ClisterJ    green  2
  • elect - elect cluster leader (all other nodes will be switched in backup mode).
% cluster elect FixEdgeJ2
Node with id [-1062725719] has become the cluster leader

FIX Server management


Usage:

% server [-h | --help] COMMAND [ARGS]

The most commonly used server commands are: * start - start fix server

% server start
Fix server successfully started
  • stop - stop fix server
% server stop
Fix server successfully stopped
  • state - show fix server current state
% server state
STARTED
  • opts - show fix server options e.g. port, state etc.
% server opts
port state
----------
8911 STARTED

FIX Session management

Usage:

% session [-h | --help] COMMAND [ARGS]

The most commonly used session commands are:

  • tr - send test request to session

  • delete - delete session

  • start - start session

  • stop - stop session

  • reset - reset session sequence numbers

  • state - show current session state

  • hb - send heartbeat to session

  • info - session info

  • ls - list all registered sessions

% session ls
Id           State         Type         SenderCompId    TargetCompId     Group
----------------------------------------------------------------------------------
iLinkTest    INACTIVE      INITIATOR    FECompId        iLink            []
session1     INACTIVE      ACCEPTOR     FECompId        Test1            [A]
session2     INACTIVE      ACCEPTOR     FECompId        Test2            [A, B, C]
  • send - send fix message to session

  • seqnum - set session in/out sequence numbers

  • tobackup - switch session from primary to backup connection

  • toprimary - switch session from backup to primary connection

  • getstart - show session scheduled start time

  • getstop - show session scheduled stop time

Management over JMX

Connecting to the remote shell

By default JMX uses port 1099 and url 'service:jmx:rmi://localhost/jndi/rmi://localhost:1099/fixedge' for connection. These parameters could be changed in fixedge.properties file (See Configuration).

You can use standard JConsole tool from Java SDK or any other JMX client to establish remote connection with provided parameters.

JMX credentials

JMX connection uses Spring Security to handle login duties. See Security configuration.

JMX controls

FEJ provides the same controls and operations through JMX and remote shell:

Cluster management

Cluster Manager MBean represents a programming interface for control over cluster nodes and its state.

The object name of the MBean is:

bean:name=clusterManager
OperationParametersReturn TypeDescription

nodeInfo

nodeId:java.lang.String

java.util.Map

Show node parameters

stopNode

nodeId:java.lang.String

boolean

Stop cluster node with given id

nodes

Not applicable

java.util.List

List of cluster nodes

health

Not applicable

java.util.List

List of cluster health attributes ( cluster name, number of nodes, cluster status)

electLeader

nodeId:java.lang.String

boolean

Make a node with a given ID a cluster leader (all other nodes will be switched in backup mode)

FIX Server management

FIX Server Manager MBean provides a programming interface for control FIX server instance.

The object name of the MBean is:

bean:name=fixServerManager
AttributeTypeAccessDescription

State

java.lang.String

read-only

FIX server current state

Options

java.util.Map

read-only

FIX server options e.g. port, state etc.

OperationParametersReturn TypeDescription

startServer

Not applicable

boolean

Start FIX server

stopServer

Not applicable

boolean

Stop FIX server

FIX Session management

FIX Session Manager MBean provides a programming interface for control over FIX sessions.

The object name of the MBean is:

bean:name=fixSessionManager
OperationParametersReturn TypeDescription

listSessions

Not applicable

java.util.List

List of FIX sessions descriptions

start

sessionId:java.lang.String

boolean

Start FIX session

stop

sessionId:java.lang.String

boolean

Stop FIX session

getInfo

sessionId:java.lang.String

java.util.Map

Session parameters (sender, target, FIX version, connectivity parameters, etc.)

getState

sessionId:java.lang.String

java.lang.String

Current FIX session state

sendMessage

sessionId:java.lang.String, message:java.lang.String

boolean

Send FIX message to given FIX session

sendTestRequest

sessionId:java.lang.String, testRequestId:java.lang.String

boolean

Send TestRequest(1) message to given FIX session

sendHeartbeat

sessionId:java.lang.String

boolean

Send Heartbeat(0) message to given FIX session

resetSeqNumbers

sessionId:java.lang.String, checkGapFillBefore:boolean

boolean

Reset sequence numbers for given FIX session

changeSeqNumbers

sessionId:java.lang.String, inValue:java.lang.String, outValue:java.lang.String

boolean

Change sequence number for FIX session

getScheduledStartTime

sessionId:java.lang.String, dateFormat:java.lang.String

java.lang.String

Return next scheduled data for FIX session start action in given format

getScheduledStopTime

sessionId:java.lang.String, dateFormat:java.lang.String

java.lang.String

Return next scheduled data for FIX session stop action in given format

switchToPrimaryConnection

sessionId:java.lang.String

boolean

Switch initiator FIX session to primary connection

switchToBackupConnection

sessionId:java.lang.String

boolean

Switch initiator FIX session to backup connection

delete

sessionId:java.lang.String

boolean

Remove FIX session



  • No labels