Table of Contents |
---|
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
.
...
Note | |||||
---|---|---|---|---|---|
| |||||
Starting from FIXEdge Java 1.9.1 in order to enable SSH service please set this property to true, if it is false or empty, SSH service will not be availablethe following parameter should be set to 'true':
Default value for ssh.enable property is 'false'. So if not set or set to 'false', SSH service will not be available. |
Code Block |
---|
$ ssh -p 2000 user@localhost Password authentication Password: ________ _____ ____ ____ ________ ______ ______ ________ _____ _ ____ ____ _ |_ __ ||_ _||_ _||_ _||_ __ ||_ _ `. .' ___ ||_ __ | |_ _| / \|_ _| |_ _|/ \ | |_ \_| | | \ \ / / | |_ \_| | | `. \/ .' \_| | |_ \_| | | / _ \ \ \ / / / _ \ | _| | | > `' < | _| _ | | | || | ____ | _| _ _ | | / ___ \ \ \ / / / ___ \ _| |_ _| |_ _/ /'`\ \_ _| |__/ | _| |_.' /\ `.___] |_| |__/ | _ | |__' | _/ / \ \_\ ' /_/ / \ \_ |_____| |_____||____||____||________||______.' `._____.'|________|(_)`.____.'|____| |____|\_/|____| |____| Welcome to Dzmitry + ! It is Sun Oct 11 05:15:22 BRT 2015 now |
...
Code Block |
---|
% 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:
Code Block |
---|
% cluster [-h | --help] COMMAND [ARGS] |
...
Code Block |
---|
% cluster elect FixEdgeJ2 Node with id [-1062725719] has become the cluster leader |
FIX Server management
Usage:
Code Block |
---|
% server [-h | --help] COMMAND [ARGS] |
...
Code Block |
---|
% server opts port state ---------- 8911 STARTED |
FIX Session management
Usage:
Code Block |
---|
% session [-h | --help] COMMAND [ARGS] |
...
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:
Code Block |
---|
% jms [-h | --help] COMMAND [ARGS] |
...
Code Block |
---|
% 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:
Code Block |
---|
% kafka [-h | --help] COMMAND [ARGS] |
...
Code Block |
---|
% 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.
...
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.
...
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.
...
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.
...
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.
...