Monitoring and management using remote shell

Introduction

FIX Edge Java includes an interactive shell that you can use to start, stop and query the FIX server and sessions. There are also useful commands to monitor the JVM.

This section introduces the main commands and features of the remote shell.

Connecting to remote shell

The 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 disconnects from the shell.

% bye
Have a good day!

Connection to localhost closed.

Remote shell credentials

The shell uses Spring Security to handle login duties. Refer to the Administrative access configuration.

Remote shell commands

After establishing a connection, the administrative shell provides an environment with a set of specific commands.

Cluster management

Usage:

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

The most commonly used cluster commands are:

% cluster stop FixEdgeJ1
Node with id [-1062725718] has stopped
% cluster info FixEdgeJ1
name      leader id          address             local
-------------------------------------------------------
FixEdgeJ1 true   -1062725718 /192.168.1.100:5701 true
% cluster nodes
Id             Name          Local          Leader          Address
--------------------------------------------------------------------------------
-1062725718    FixEdgeJ1     this           this            /192.168.1.100:5701
-1062725719    FixEdgeJ2                                    /192.168.1.101:5701
% cluster health
clusterName status numberOfNodes
---------------------------------
ClisterJ    green  2
% 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: 

% server start
Fix server successfully started
% server stop
Fix server successfully stopped
% server state
STARTED
% server opts
port state
----------
8911 STARTED

FIX Session management

Usage:

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

The most commonly used session commands are:

% 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]

JMS management

Usage:

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

The most commonly used JMS commands are:

% jms state JMS_IN
CREATED
% jms ls
Id             State               Type                  MessagingMode          ProviderURL            DestinationURI
JMS_IN         CREATED             Consumer              Queue                  tcp://localhost:61616  queueSend
JMS_OUT        CREATED             Producer              Queue                  tcp://localhost:61616  queueSend

Kafka management

Usage:

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

The most commonly used Kafka commands are:

% kafka state consumer1
CONNECTED
% kafka ls
Id              State                Type                   Server                  Topics
consumer1       CONNECTED            Consumer               localhost:9092          consumer
producer1       CREATED              Producer               localhost:9092          producer

Management over JMX

Connecting to remote shell

By default, JMX uses the 1099 port and the 'service:jmx:rmi://localhost/jndi/rmi://localhost:1099/fixedge' URL for the connection. These parameters can be changed in the fixedge.properties file. Refer to the Administrative JMX configuration.

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

JMX credentials

The JMX connection uses Spring Security to handle login duties. Refer to the Administrative access configuration section.

JMX controls

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

Cluster management

The 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 a cluster node with a 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 to the backup mode)

FIX Server management

The FIX Server Manager MBean provides a programming interface for controlling the 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, for example, port, state, etc.

OperationParametersReturn TypeDescription

startServer

Not applicable

boolean

Start the FIX server

stopServer

Not applicable

boolean

Stop the FIX server

FIX Session management

The FIX Session Manager MBean provides a programming interface for controlling FIX sessions.

The object name of the MBean is:

bean:name=fixSessionManager
OperationParametersReturn TypeDescription

listSessions

Not applicable

java.util.List

List of FIX session descriptions

start

sessionId:java.lang.String

boolean

Start a FIX session

stop

sessionId:java.lang.String

boolean

Stop a FIX session

loadsessionId:java.lang.StringbooleanLoad a new FIX session from the config file
reloadsessionId:java.lang.String, isForceReload:booleanbooleanReload a FIX session from the config file

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

FIX session current state

sendMessage

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

boolean

Send a FIX message to a given FIX session

sendTestRequest

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

boolean

Send a TestRequest(1) message to a given FIX session

sendHeartbeat

sessionId:java.lang.String

boolean

Send the Heartbeat(0) message to a given FIX session

resetSeqNumbers

sessionId:java.lang.String, checkGapFillBefore:boolean

boolean

Reset given FIX session’s sequence numbers

changeSeqNumbers

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

boolean

Change given FIX session’s sequence numbers

getScheduledStartTime

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

java.lang.String

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

getScheduledStopTime

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

java.lang.String

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

switchToPrimaryConnection

sessionId:java.lang.String

boolean

Switch an initiator FIX session to the primary connection

switchToBackupConnection

sessionId:java.lang.String

boolean

Switch an initiator FIX session to the backup connection

delete

sessionId:java.lang.String

boolean

Remove a FIX session

JMS management

The JMS Manager MBean provides a programming interface for controlling JMS clients.

The object name of the MBean is:

bean:name=jmsManager
OperationParametersReturn TypeDescription

listClients

Not applicable

java.util.List

List of JMS client descriptions

start

clientId:java.lang.String

boolean

Start the JMS client

stop

clientId:java.lang.String

boolean

Stop the JMS client

getClientParams

clientId:java.lang.String

java.util.Map

JMS parameters (connectivity parameters, etc.)

getClientState

clientId:java.lang.String

java.lang.String

JMS client current state

sendMessage

clientId:java.lang.String, message:java.lang.String

boolean

Send a FIX message to a given JMS client

Kafka management

The Kafka Manager MBean provides a programming interface for controlling Kafka clients.

The object name of the MBean is:

bean:name=kafkaManager
OperationParametersReturn TypeDescription

listClients

Not applicable

java.util.List

List of Kafka client descriptions

start

clientId:java.lang.String

boolean

Start the Kafka client

stop

clientId:java.lang.String

boolean

Stop the Kafka client

getClientParams

clientId:java.lang.String

java.util.Map

Kafka parameters (connectivity parameters, etc.)

getClientState

clientId:java.lang.String

java.lang.String

Kafka client current state

sendMessage

clientId:java.lang.String, message:java.lang.String

boolean

Send a FIX message to a given Kafka client