Skip to content

QFJ-888: DefaultMessageFactory does not support FIX5.0 SP1/2 #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 8, 2018
Merged

QFJ-888: DefaultMessageFactory does not support FIX5.0 SP1/2 #171

merged 3 commits into from
Feb 8, 2018

Conversation

ckolek
Copy link
Contributor

@ckolek ckolek commented Feb 1, 2018

The background for this change is described in QFJ-888.

Changes are as follows:

  1. Added a new create method to MessageFactory which accepts an ApplVerID. The default behavior of the new method is to call MessageFactory.create(beginString, msgType) in order to maintain backwards compatibility.
  2. Modified MessageUtils.parse to call the new create method, passing in the ApplVerID acquired from the incoming message or the session. Other calls to MessageFactory.create have remained as-is.
  3. Added a new constructor to DefaultMessageFactory which accepts an ApplVerID value to be used as the default when create(beginString, msgType) or create(beginString, null, msgType) is called. The existing constructor calls the new one, passing in ApplVerID.FIX50 in order to maintain backwards compatibility.
  4. Implementation of message creation in DefaultMessageFactory has been moved to the new create method. The old create method calls create(beginString, null, msgType). In the case where applVerID is null, the defaultApplVerID is used instead.

Ultimately, these changes provide the following:

  1. Developers who use DefaultMessageFactory can now specify a default ApplVerID to be used for FIXT message construction.
  2. FIXT message construction is now done dynamically according to the ApplVerID in the incoming message/session.

Add DefaultMessageFactory constructor which accepts defaultApplVerID value.
@chrjohn
Copy link
Member

chrjohn commented Feb 1, 2018

Hi @ckolek ,
thanks for the PR. Looks good to me at first glance, will look at it more closely later.
One thing: there are two acceptance tests failing because of this change (the SSL related tests can be ignored for now):

[ERROR] fix50/2r_UnregisteredMsgType.def(quickfix.test.acceptance.AcceptanceTestSuite$AcceptanceTest)  Time elapsed: 5.221 s  <<< FAILURE!
org.junit.ComparisonFailure: wrong msg type expected:<[j]> but was:<[0]>
	at quickfix.test.acceptance.AcceptanceTestSuite$AcceptanceTest.run(AcceptanceTestSuite.java:78)
[ERROR] fix50/8_AdminAndApplicationMessages-FIX50SP2.def(quickfix.test.acceptance.AcceptanceTestSuite$AcceptanceTest)  Time elapsed: 5.95 s  <<< FAILURE!
org.junit.ComparisonFailure: wrong msg type expected:<[D]> but was:<[0]>
	at quickfix.test.acceptance.AcceptanceTestSuite$AcceptanceTest.run(AcceptanceTestSuite.java:78)

It looks like the session is only heartbeating instead of sending the expected messages.
If you need help fixing this please let me know so I can take a closer look.

Cheers,
Chris.

@ckolek
Copy link
Contributor Author

ckolek commented Feb 1, 2018

I made the mistake of passing in the FIX50 BeginString rather than the FIX50 ApplVerID in the DefaultMessageFactory default constructor. I'll update the PR.

@chrjohn chrjohn added this to the QFJ 2.1.0 milestone Feb 5, 2018
@chrjohn chrjohn merged commit ecef090 into quickfix-j:master Feb 8, 2018
@ckolek ckolek deleted the jira/QFJ-888 branch February 8, 2018 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants