Pergunta

I want to persist a fix4.2 message to database by retrieving the value of each tag. I am having the ExecutionReport object of the fix message. I am retrieving the tag value of account using exec.getString(1) and this tag value is not present in the message so it is throwing FieldNotFound exception. In Fiximate I found that account is not a mandatory field.

I also tried with exec.getAccount().getValue() but got same exception. I found that every all these method throws FieldNotFound exception.

Is there any way to retrieve the tag value as null if that non-mandatory field is not present in the fix message.

Any help will be highly appreciated.

Thanks in advance.

Regards, Shadab

Foi útil?

Solução

You didn't say which QuickFIX port you are using (e.g. the original QF for C++, QF/J for Java, QF/n for C#).

If a field is not required, you simply need to test for its presence first.

C++: exec.isSetField(1) or exec.isSetField(field)
(there might also be a exec.isSetAccount(), not sure)

Java: exec.isSetField(1) or exec.isSetAccount() or exec.isSetField(field)

C#: exec.IsSet(1) or exec.IsSetAccount() or exec.IsSetField(field)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top