Question

So I am trying to generate repeating groups in a FIX message, but I need a method to determine which fields are required for each repeating group so I don't have to hard code everything. For some reason, the quickfix DataDictionary class's method

isRequiredField((java.lang.String msgType, int field)

does not work for required fields within repeating groups. For example

isRequiredField("V", 269)

gives false, even thought it is required. The Fix 4.2 XML also has it as required so why does the isRequiredField method return false?

Was it helpful?

Solution

I think you need getGroup(java.lang.String msg, int field), where field is the tag for the group's counter field.

That will give you a DataDictionary.GroupInfo object, and on that you can call getDataDictionary().isRequiredField(msgType,field) (use the same message type).

I think that'll work, anyway. The docs aren't explicitly clear on this.

But why are you doing this?

To be honest, I'm not sure why you think you need to do this. There's simply no need to dynamically query which fields are required. When receiving, the engine checks the required/not-required for you. When you're sending, you have to set values to all the required fields anyway (you can't dynamically do that!).

Unless you are writing some kind of DD-analysis tool, I think you're spending your time investigating a red herring.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top