[QFJ-422] DefaultMessageFactory doesn't set the MsgType field when it defaults to creating the Message itself Created: 21/Mar/09  Updated: 15/Nov/12  Resolved: 26/May/09

Status: Closed
Project: QuickFIX/J
Component/s: Message Generation
Affects Version/s: 1.4.0
Fix Version/s: 1.5.0

Type: Bug Priority: Default
Reporter: Tom Palmer Assignee: Laurent Danesi
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File DefaultMessageFactory.patch    

 Description   

If there are no version-specific MessageFactory's in the classpath the DefaultMessageFactory will create an empty message. Unfortunately it forgets to set the MsgType which other elements of the QuickFIX/J code rely upon e.g. quickfix.Session. Below is an example stack trace in that situation:

quickfix.FieldNotFound: Field [35] was not found in message.
at quickfix.FieldMap.getField(FieldMap.java:213)
at quickfix.FieldMap.getString(FieldMap.java:207)
at quickfix.Session.sendRaw(Session.java:1758)
at quickfix.Session.generateLogon(Session.java:1746)
at quickfix.Session.nextLogon(Session.java:1591)
at quickfix.Session.next(Session.java:782)
at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:107)
at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70)
at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:87)
at java.lang.Thread.run(Thread.java:637)



 Comments   
Comment by Tom Palmer [ 21/Mar/09 ]

The attached patch resolves this issue and adds an additional assert to quickfix.DefaultMessageFactoryTest to make sure that the MsgType field is always set on each of the messages created.

Comment by Laurent Danesi [ 26/May/09 ]

Thank you Tom.

I will check your path and apply it.

Laurent

Generated at Sat Apr 27 08:46:37 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.