Remote administration

Description

FIX Antenna provides access to embedded monitoring and administrative functionality by means of usual sessions. All sessions with TargetCompID equal to FIXADMIN are treated as service sessions and have exclusive processing. FIX XML message (MsgType = n) is used to transport commands or execution results in XML form. To identify command MonitoringRequestId tag (9207) is included in XML message. This tag is returned in response, so several commands can be sent in consecutive order.

To enable monitoring functionality set Monitoring.enable parameter to 'true' value and define necessary administrative session parameters. If monitoring is disabled, sessions with TargetCompID equal to FIXADMIN are processed as usual.

Monitoring requires FIX protocol customization of the XML(n) message in following way:

<fixdic fixversion="4.4" title="FA Monitoring FIX 4.4" date="2008/05/12">
        <fielddic>
                <fielddef tag="9207" name="MonitoringRequestId" type="String"/>
        </fielddic>
        <msgdic>
                <msgdef msgtype="n">
                        <field tag="9207" req="N"/>
                </msgdef>
        </msgdic>
</fixdic>
All other protocols can be customized the same way.

Supported commands

Monitoring and administrative commands as well as execution results are transported using FIX XML message (MsgType = n). XML Schema of command requests and responses is defined in FAMonitoring.xsd document.

SessionsList - get list of sessions

Example of request:
<SessionsList />
Example of response:
<Response ResultCode="0">
<SessionsListData>
        <Session>
                <SenderCompID>TestSender</SenderCompID>
                <TargetCompID>TestTarget</TargetCompID>
        </Session>
        <Session>
                <SenderCompID>TROIOI</SenderCompID>
                <TargetCompID>AUTEX</TargetCompID>
        </Session>
</SessionsListData>
</Response>

SessionStat - get detailed information about session

Example of request:
<SessionStat>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
</SessionStat>
Example of response:
<Response ResultCode="0">
        <SessionStatData>
                <SenderCompID>TestSender</SenderCompID>
                <TargetCompID>TestTarget</TargetCompID>
                <ReceivedBytes>5107901</ReceivedBytes>
                <SentBytes>6445854</SentBytes>
                <ReceivedMessages>25539</ReceivedMessages>
                <SentMessages>32229</SentMessages>
                <ReceivedHandlingTime>5782453</ReceivedHandlingTime>
                <SentHandlingTime>7143127</SentHandlingTime>
                <Established>2008-05-13T07:55:23</Established>
                <TerminatedNormal>2008-05-13T07:51:34</TerminatedNormal>
                <TerminatedAbnormal>2008-05-10T15:43:11</TerminatedAbnormal>
                <DurationSum>94734720</DurationSum>
                <LastReceivedMessage>2008-05-13T18:21:10</LastReceivedMessage>
                <LastSentMessage>2008-05-13T18:21:10</LastSentMessage>
        <SessionStatData>
</Response>

SessionStatus - get status of session

Example of request:
<SessionStatus>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
</SessionStatus>
Example of response:
<Response  ResultCode="0">
        <SessionStatusData>
                <SenderCompID>TestSender</SenderCompID>
                <TargetCompID>TestTarget</TargetCompID>
                <Status>WaitForConfirmLogout</Status>
        </SessionStatusData>
</Response>

GeneralSessionsStat - get statistical information about the current state of FIX Antenna

Example of request:
<GeneralSessionsStat />
Example of response:
<Response ResultCode="0">
        <GeneralSessionsStatData>
                <ActiveSessions>2</ActiveSessions>
                <ReconnectingSessions>1</ReconnectingSessions>
                <AwaitingSessions>0</AwaitingSessions> 
                <TerminatedNormalSessions>32</TerminatedNormalSessions>
                <TerminatedAbnormalSessions>5</TerminatedAbnormalSessions>
</GeneralSessionsStatData>
</Response>

AverageReceivedStat - get average handling time for received messages

Example of request:
<AverageReceivedStat>
        <Version>FIX42</Version>
        <Type>D</Type> 
</AverageReceivedStat>
Example of response:
<Response ResultCode="0"> 
        <AverageReceivedStatData>
                <Version>FIX42</Version>
                <Type>D</Type>
                <AverageTime>226</AverageTime>
        </AverageReceivedStatData>
</Response>

AverageSentStat - get average handling time for sent messages

Example of request:
<AverageSentStat>
        <Version>FIX42</Version>
        <Type>8</Type> 
</AverageSentStat>
Example of response:
<Response ResultCode="0"> 
        <AverageSentStatData>
                <Version>FIX42</Version>
                <Type>8</Type>
                <AverageTime>221</AverageTime>
        </AverageSentStatData>
</Response>

AverageValidateStat - get average validation time for messages

Example of request:
<AverageValidateStat>
        <Version>FIX42</Version>
        <Type>8</Type> 
</AverageValidateStat>
Example of response:
<Response ResultCode="0"> 
        <AverageValidateStatData>
                <Version>FIX42</Version>
                <Type>8</Type>
                <AverageTime>142</AverageTime>
        </AverageValidateStatData>
</Response>

ReceivedStat - get received message amount

Example of request:
<ReceivedStat />
Example of response:
<Response ResultCode="0">
        <ReceivedStatData>
                <ReceivedMessages>76617</ReceivedMessages>
        </ReceivedStatData>
</Response>

SentStat - get sent message amount

Example of request:
<SentStat />
Example of response:
<Response ResultCode="0"> 
        <SentStatData>
                <SentMessages>96687</SentMessages>
        </SentStatData>
</Response>

ProceedStat - get proceed message amount

Example of request:
<ProceedStat />
Example of response:
<Response ResultCode="0">
        <ProceedStatData>
                <ProceedMessages>173304</ProceedMessages>
        </ProceedStatData>
</Response>

\subsection sec_21_2_11 CreateAcceptor - creates FIX session as acceptor
Example of request:
\code
<CreateAcceptor>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
        <Version>FIX44</Version>
</CreateAcceptor>
Example of response:
<Response ResultCode="0"/>

Delete - deletes FIX session

Example of request:
<Delete>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
        <SendLogout>true</SendLogout>
        <LogoutReason>Evacuation</LogoutReason>
</Delete>
Example of response:
<Response ResultCode="0"/>
As Delete is asynchronous command, successful result means that execution is started, but there is no guarantee of its successful finish.

ToBackup - switches FIX session to backup connection

Example of request:
<ToBackup>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
</ToBackup>
Example of response: 
\code
<Response ResultCode="3">
        <Description>Unknown session</Description> 
</Response>

ChangeSeqNum - changes session sequence number

Example of request:
<ChangeSeqNum>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
        <InSeqNum>100</InSeqNum>
        <OutSeqNum>100</OutSeqNum>
</ChangeSeqNum>
Example of response:
\code
<Response ResultCode="0"/>

ResetSeqNum - resets session sequence number (force seqnum reset logon)

Example of request:
<ResetSeqNum>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
</ResetSeqNum>
Example of response:
<Response ResultCode="0"/>

TestRequest - sends Test Request message to session

Example of request:
<TestRequest> 
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
        <TestReqID>12345576</TestReqID>
</TestRequest>
Example of response:
\code
<Response ResultCode="0"/>

Heartbeat - sends Heartbeat message to session

Example of request:
<Heartbeat>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
</Heartbeat>
Example of response:
\code
<Response ResultCode="0"/>

SendMessage - sends message to session

Example of request:
<SendMessage>
        <SenderCompID>TestSender</SenderCompID>
        <TargetCompID>TestTarget</TargetCompID>
        <Message>8=FIX.4.29=05635=849=THEM56=US37=117=134=53011=00492-0476150=039=010=161</Message>
</SendMessage>
Example of response:
<Response ResultCode="0"/>

DeleteAll - deletes all FIX sessions

Example of request:
<DeleteAll>
        <SendLogout>true</SendLogout>
        <LogoutReason>Evacuation</LogoutReason>
</DeleteAll>
Example of response:
<Response ResultCode="0">
        <DeleteAllData>
                <Deleted>4</Deleted>
                <Failed>
                        <Session>
                                <SenderCompID>TestSender</SenderCompID>
                                <TargetCompID>TestTarget</TargetCompID>
                                <Description>Access denied</Description>
                        </Session>
                </Failed>
        </DeleteAllData>
</Response>
As DeleteAll is asynchronous command, successful result means that execution is started, but there is no guarantee of its successful finish.

Help - get list of supported commands

Example of request:
<Help />
Example of response:
<Response ResultCode="0">
        <HelpData>
                <DeleteAll>
                        <Description>deletes all FIX sessions</Description>
                        <Parameter> 
                                <Name>SendLogout</Name>
                                <Description>flag defines wheter logout must be sent</Description>
                                <IsRequired>false</IsRequired>
                                <DefaultValue>true</DefaultValue>
                                <Value>true</Value><Value>false</Value>
                        </Parameter>
                        <Parameter> 
                                <Name>LogoutReason</Name>
                                <Description>disconnect reason</Description>
                                <IsRequired>false</IsRequired>
                        </Parameter>
                </DeleteAll>
                <Help>
                        <Description>get list of supported commands</Description>
                </Help>
        </HelpData>
</Response>

Creating administrative session

Administrative session will be automatically created, if user creates FIX session with TargetCompID equal to 'FIXADMIN' and connect it to the FixAntenna. After connection established FIX XML(n) messages with administrative commands can be sent to FIX Antenna.

Implementing custom administrative commands

User is allowed to customize Fix Antenna monitoring: add new administrative commands, use another kind of FIX messages, etc. To extend basic monitoring functionality it's required to inherit user's class from AdminApplication base class and override AdminApplication::process(const std::string&, const DOMNode*, const Context&) method. Description of supported commands can be updated in overriden AdminApplication::getAvailableCommands method. Messages different from FIX XML message can be processed in overriden AdminApplication::process(const FIXMessage&, const Session&) method.

class CustomAdmin : public Engine::AdminApplication{
    public:
        virtual bool process(const std::string& action, const DOMNode* element, const Context& context){
            if (action == "ImplementationVersion") {
                sendResponse("<?xml version=\"1.0\"?><Response ResultCode=\"0\">"
                             "<ImplementationVersionData>" + strVERSION + "</ImplementationVersionData></Response>", context);
                return true;
            }
            return AdminApplication::process(action, element, context);
        } 
   
        virtual void getAvailableCommands(AdminApplication::CommandTable* commands) const {
                AdminApplication::getAvailableCommands(commands);

                (*commands)["ImplementationVersion"] = 
                "<ImplementationVersion>"
                        "<Description>get version of server implementation</Description>"
                "</ImplementationVersion>";
        }
};

Registering custom administrative application

Fix Antenna will use derived class only after calling FixEngine::registerAdminApplication method:
CustomAdmin adminApp;
FixEngine::singleton()->registerAdminApplication(&adminApp);
// ... - business logic
FixEngine::singleton()->registerAdminApplication(NULL);

Generated on Fri Apr 17 12:26:08 2009 for B2BITS FIX Antenna C++ by  doxygen 1.5.6