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.
Note:
Starting from FIXEdge Java 1.9.1 in order to enable SSH service the following parameter should be set to 'true':
ssh.enable=true
Default value for ssh.enable property is 'false'. So if not set or set to 'false', SSH service will not be available.
$ 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:
stop
- stops the node with the given ID
% cluster stop FixEdgeJ1 Node with id [-1062725718] has stopped
info
- shows the node info
% cluster info FixEdgeJ1 name leader id address local ------------------------------------------------------- FixEdgeJ1 true -1062725718 /192.168.1.100:5701 true
nodes
- displays the 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
- shows the health status of the cluster
% cluster health clusterName status numberOfNodes --------------------------------- ClisterJ green 2
elect
- elects the cluster leader (all other nodes will be switched to the 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
- starts the FIX server
% server start Fix server successfully started
stop
- stops the FIX server
% server stop Fix server successfully stopped
state
- shows the current state of the FIX server
% server state STARTED
opts
- shows FIX server options such as 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
- sends a test request to the sessiondelete
- deletes a sessionstart
- starts a sessionstop
- stops a sessionload
- load a new FIX session from a config filereload
- reload the FIX session from a config file (use the --force or -f attribute to reload the session which is currently in the CONNECTED state)reset
- resets session sequence numbersstate
- shows the current session statehb
- sends a heartbeat to the sessioninfo
- returns session infols
- displays the list of 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
- sends a FIXmessage to the session (tag delimiters in the message should be pipes '|' and the message should be in quotes)seqnum
- sets a session’s in/out sequence numberstobackup
- switches a session from primary to backup connectiontoprimary
- switches a session from backup to primary connectiongetstart
- shows the session’s scheduled start timegetstop
- shows the session’s scheduled stop time
JMS management
Usage:
% jms [-h | --help] COMMAND [ARGS]
The most commonly used JMS commands are:
start
- starts the JMS clientstop
- stops the JMS clientstate
- shows the JMS client's current state
% jms state JMS_IN CREATED
info
- returns JMS client infosend
- sends a FIX message to JMS clients (tag delimiters in the message should be pipes '|', JMS client should be Producer)ls
- displays the list of all registered JMS clients
% 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:
start
- starts the Kafka clientstop
- stops the Kafka clientstate
- shows the Kafka client's current state
% kafka state consumer1 CONNECTED
info
- returns Kafka client infosend
- sends a FIX message to the Kafka client (tag delimiters in the message should be pipes '|')ls
- displays the list of all registered Kafka clients
% 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
Operation | Parameters | Return Type | Description |
---|---|---|---|
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
Attribute | Type | Access | Description |
---|---|---|---|
State | java.lang.String | read-only | FIX server current state |
Options | java.util.Map | read-only | FIX server options, for example, port, state, etc. |
Operation | Parameters | Return Type | Description |
---|---|---|---|
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
Operation | Parameters | Return Type | Description |
---|---|---|---|
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 |
load | sessionId:java.lang.String | boolean | Load a new FIX session from the config file |
reload | sessionId:java.lang.String, isForceReload:boolean | boolean | Reload 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
Operation | Parameters | Return Type | Description |
---|---|---|---|
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
Operation | Parameters | Return Type | Description |
---|---|---|---|
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 |