MateodelNorte
MateodelNorte

Reputation: 1280

quickfix C+ Incorrect BeginString with FIXT.1.1 and FIX.5.0 - FIX.5.0SP2

I'm creating an initiator and acceptor which speak FIX.5.0SP2. I'm getting an "58":"Incorrect BeginString" error on logon, on the acceptor (and on fromAdmin on the initiator). I believe my configs are correct:

initiator:

# default settings for sessions
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=60
UseLocalTime=Y
PersistMessages=Y
FileStorePath=./data
FileLogPath=./log
HttpAcceptPort=9016
SenderCompID=X
BeginString=FIXT.1.1
TransportDataDictionary=./support/FIXT11.xml

[SESSION]
TargetCompID=Y
StartTime=00:00:00
EndTime=23:59:59
HeartBtInt=30
SocketConnectPort=8599
SocketConnectHost=localhost
DefaultApplVerID=FIX.5.0SP2
AppDataDictionary=./support/FIX50SP2.xml

acceptor:

# default settings for sessions
[DEFAULT]
ConnectionType=acceptor
ReconnectInterval=60
UseLocalTime=Y
PersistMessages=Y
PostgreSQLStoreDatabase=quickfix
PostgreSQLStoreUser=xx
PostgreSQLStoreHost=localhost
PostgreSQLStorePort=5432
PostgreSQLStoreUseConnectionPool=Y
PostgreSQLLogDatabase=quickfix
PostgreSQLLogUser=electronifie
PostgreSQLLogHost=localhost
PostgreSQLLogPort=5432
PostgreSQLLogUseConnectionPool=Y
FileStorePath=./data
FileLogPath=./log
HttpAcceptPort=9212
SenderCompID=Y
BeginString=FIXT.1.1
TransportDataDictionary=./support/FIXT11.xml

[SESSION]
TargetCompID=X
StartTime=00:00:00
EndTime=23:59:59
HeartBtInt=30
SocketAcceptPort=8599
DefaultApplVerID=FIX.5.0SP2
AppDataDictionary=./support/FIX50SP2.xml

I've tried all sorts of permutations and none seem to work.

Is there an error in the BeginString logic?

Thanks,

Matt

EDIT: adding logs:

acceptor event log: http://gist.github.com/mateodelnorte/167a83990801d7bb506e 
acceptor message log: http://gist.github.com/mateodelnorte/6d1f400a4e61875afee9 

initiator event log: http://gist.github.com/mateodelnorte/a376c6cc0eb0f71bd222 
initiator message log: http://gist.github.com/mateodelnorte/5c1b0c4ca2dda3e93b29 

Upvotes: 0

Views: 3439

Answers (4)

Mahesh Malpani
Mahesh Malpani

Reputation: 1989

In .net core each version has different nuget. In my case I have used the generic QuickFix package. So reference to FIX50SP2 was missing. Same classes where in fix44 and hence its giving error.

Upvotes: 0

Antônio Meireles
Antônio Meireles

Reputation: 11

The DefaultMessageFactory try to load versioned messages' dlls (QuickFIXn.FIX*.dll) and find a factory implementation for each version:

/// <summary>
/// This constructor will
/// 1. Dynamically load all QuickFix.*.dll assemblies into the current appdomain
/// 2. Find all IMessageFactory implementations in these assemblies (must have parameterless constructor)
/// 3. Use them based on begin strings they support
/// </summary>
/// <param name="defaultApplVerId">ApplVerID value used by default in Create methods that don't explicitly specify it (only relevant for FIX5+)</param>
public DefaultMessageFactory(string defaultApplVerId = QuickFix.FixValues.ApplVerID.FIX50SP2)
{
    _defaultApplVerId = new ApplVerID(defaultApplVerId);
    var assemblies = GetAppDomainAssemblies();
    var factories = GetMessageFactories(assemblies);
    _factories = ConvertToDictionary(factories);
}

Then when you receive an application message, it looks for the versioned factory.

If you do not have the dll in your path, the factory was not loaded, and it will generate an "Incorrect BeginString (FIXT.1.1)" error.

In my case I was not using versioned messages, only generic classes like Quickfix.Message and Quickfix.Group, so I was only using QuickFIXn.Core.dll. The first application message I received (a FIX.5.0SP2 message) raised this error.

To fix it I added a reference to QuickFIXn.FIX.5.0SP2.dll, and now the dll is shipped with my binaries, the dll is loaded, the factory is found, and no more error.

Upvotes: 1

Please, you can try as follow [SESSION] BeginString=FIXT.1.1 BeginString=FIX.VERSION

Upvotes: 0

Salgar
Salgar

Reputation: 7775

Check your dictionary, it should say something like

<fix type='FIXT' major='1' minor='1' servicepack='0'>

If the dictionary on the acceptor receives a version that isn't in the dictionary it will return that error.

Upvotes: 6

Related Questions