Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-286

Sequence number not correct after ResendRequest when PersistMessages=N (ATServer configuration)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.5.0
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      WinXP x64

      Description

      Case 8_OnlyAminMessages.def faild.

      Suggestion for solution in Session.java:

      private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon,
      FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType,
      InvalidMessage {
      if (!verify(resendRequest, false, false))

      { return; }

      int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD);
      int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD);

      getLog().onEvent("Received ResendRequest FROM: " + beginSeqNo + " TO: " + endSeqNo);

      String beginString = sessionID.getBeginString();
      int expectedSenderNum = getExpectedSenderNum();
      if (beginString.compareTo(FixVersions.BEGINSTRING_FIX42) >= 0 && endSeqNo == 0

      beginString.compareTo(FixVersions.BEGINSTRING_FIX42) <= 0 && endSeqNo == 999999
      endSeqNo >= expectedSenderNum) { endSeqNo = expectedSenderNum - 1; }

      if (!persistMessages) {
      endSeqNo += 1;
      int next = state.getNextSenderMsgSeqNum();
      if (endSeqNo > next)

      { endSeqNo = next; }

      generateSequenceReset(beginSeqNo, endSeqNo);

      }
      else {
      ArrayList<String> messages = new ArrayList<String>();
      state.get(beginSeqNo, endSeqNo, messages);

      int msgSeqNum = 0;
      int begin = 0;
      int current = beginSeqNo;

      for (String message : messages) {
      Message msg = parseMessage((String) message);
      msgSeqNum = msg.getHeader().getInt(MsgSeqNum.FIELD);
      String msgType = msg.getHeader().getString(MsgType.FIELD);

      if ((current != msgSeqNum) && begin == 0)

      { begin = current; }

      if (msgType.length() == 1 && "0A12345".indexOf(msgType) != -1) {
      if (begin == 0)

      { begin = msgSeqNum; }

      } else {
      if (resend(msg)) {
      if (begin != 0)

      { generateSequenceReset(begin, msgSeqNum); }

      send(msg.toString());
      getLog().onEvent("Resending Message: " + msgSeqNum);
      begin = 0;
      } else

      { if (begin == 0) begin = msgSeqNum; }

      }
      current = msgSeqNum + 1;
      }

      if (begin != 0)

      { generateSequenceReset(begin, msgSeqNum + 1); }

      if (endSeqNo > msgSeqNum)

      { endSeqNo = endSeqNo + 1; int next = state.getNextSenderMsgSeqNum(); if (endSeqNo > next) endSeqNo = next; generateSequenceReset(beginSeqNo, endSeqNo); }

      }

      int tMsgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD);
      if (!isTargetTooHigh(tMsgSeqNum) && !isTargetTooLow(tMsgSeqNum))

      { state.incrNextTargetMsgSeqNum(); }

      }

        Attachments

          Activity

            People

            • Assignee:
              sbate Steve Bate
              Reporter:
              peter_900 Peter Eriksson
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: