--- core/src/main/java/quickfix/DataDictionary.java (original) +++ core/src/main/java/quickfix/DataDictionary.java @@ -617,9 +617,11 @@ } if (beginString != null && shouldCheckTag(field)) { - dd.checkValidTagNumber(field); - if (map instanceof Message) { - checkIsInMessage(field, msgType); + if(!allowUnknownMessageFields) { + dd.checkValidTagNumber(field); + if (map instanceof Message) { + checkIsInMessage(field, msgType); + } } dd.checkGroupCount(field, map, msgType); } @@ -741,7 +743,7 @@ // / Check if a field is in this message type. private void checkIsInMessage(Field field, String msgType) { - if (!isMsgField(msgType, field.getField()) && !allowUnknownMessageFields) { + if (!isMsgField(msgType, field.getField())) { throw new FieldException(SessionRejectReason.TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE, field.getField()); }