The FIX adapter configuration will need:
- a StreamBaseFIX Configuration file to configure the session
- a fixengine.properties file to add the handleSeqNumAtLogon setting
- a FIX Custom Admin Message Interceptor class to add additional Logon(A) tags
Configuring StreamBaseFIX XML Configuration Session Settings
For FIX protocol version FIX50SP2 and FIXT1.1 set session properties:
<version>FIX.5.0SP2</version>
<begin-string>FIXT.1.1</begin-string>
along with the other settings required by the venue.
Most venues require setting:
<reset-on-logon>false</reset-on-logon>
This maintains the session through intra-day disconnection and reconnection.
You may also set the interceptor classname here:
<message-interceptor>package-and-class-name</message-interceptor>
There is also an adapter property, "
FIX Admin Message Interceptor Class", for this value. Set this in one place or the other, not in both places.
Configuring fixengine.properties Settings
In order to handle
NextExpectedMsgSeqNum(789) tag processing, add to the
fixengine.properties file:
# Include a NextExpectedMsgSeqNum(789) tag in the outgoing Logon message, and properly process return ones.
handleSeqNumAtLogon=true
This will cause outgoing Logon messages to contain a properly set 789 field, and incoming Logon messages with tag 789 will also behave appropriately by responding with a message replay or a
MsgSeqNum reset in the case of a mismatch in expected vs effective
MsgSeqNum value.
Configuring a FIX Custom Admin Message Interceptor
This is a simple
FIXTAdminMessageInterceptor which implements the
getOutgoingLoginFields() method:
package com.sb.support;
import com.streambase.sb.adapter.fix.engine.antenna.FIXAJMessageInterceptor;
import java.io.InputStream;
import org.slf4j.Logger;
import com.epam.fix.message.FIXFieldList;
import com.streambase.sb.StreamBaseException;
public class FIXTAdminMessageInterceptor implements FIXAJMessageInterceptor {
@Override
public FIXFieldList getHeaderFields(String arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public FIXFieldList getOutgoingLoginFields(String arg0) {
FIXFieldList ff = new FIXFieldList();
ff.addTag( 553, "someuser"); // Username
ff.addTag( 554, "secrets"); // Password
ff.addTag(1407, "9"); // DefaultApplExtID
return ff;
}
@Override
public void setConfigFile(Logger arg0, InputStream arg1) throws StreamBaseException {
// TODO Auto-generated method stub
// Here is where to read the session configuration file to find and replace the hard-coded values above
}
}
The libraries needed for the
import statements are:
- StreamBase Client (for StreamBaseException)
- slf4j-api-{ver}.jar (for Logger, from C:\tibco\sb-cep\7.7\lib)
- sb-fix-core.jar (for FIXAJMessageInterceptor, from C:\tibco\sb-cep\7.7\lib\ext)
- fixaj-engine-all-{ver}.jar (for com.epam classes, from C:\tibco\sb-cep\7.7\lib\ext)
Set the interceptor in either the
StreamBaseFIX-config.xml <message-interceptor> or in the FIX Output adapter properties
FIX Admin Message Interceptor Class =
com.sb.support.FIXTAdminMessageInterceptor.
Change the package from "com.sb.support" to any path that makes sense for your organization.
Additional Settings for Special Cases
The FIX adapter also has specific properties for the following cases (which do not need a custom FIXAJMessageInterceptor class):
- Perform User-Level Logon Procedure (BE / BF FIX messages)
- Use SenderSubID Field To Identify Session
- Use SenderLocationID Field To Identify Session
- Use TargetSubID Field To Identify Session
- Use TargetLocationID Field To Identify Session
Other additional message
Header fields for every message may be set in the interceptor
getHeaderFields() method similarly to the example above for the
getOutgoingLoginFields() method. Additional message
body fields are set in the outgoing tuple for each message sent.
Additional
fixengine.properties settings which your venue might require can be found at:
B2BITS FIX Antenna Java Programmer's Guide > ConfigurationThe settings here enable engine features in addition to those enabled by adapter properties.