|
From: charles m. <xl...@gm...> - 2021-03-26 03:21:35
|
Hi,Christoph,
First of all Thanks for your reply!
Yes ,the Acceptor also a QFJ engine.
Based on the QFJ version I use, the order of sending the message is to send
SequenceReset first, and then resend the ExecReport with a sequence of 646.
See the code below, I made a note in the key position. Since EndSeqNo=0 in
the ResendRequest sent by the Acceptor, so When resend, the message with
sequence 646 will also be resent.
private void resendMessages(Message receivedMessage, int beginSeqNo, int
endSeqNo)
throws IOException, InvalidMessage, FieldNotFound {
final ArrayList<String> messages = new ArrayList<>();
try {
state.get(beginSeqNo, endSeqNo, messages);
} catch (final IOException e) {
if (forceResendWhenCorruptedStore) {
LOG.error("Cannot read messages from stores, resend
HeartBeats", e);
for (int i = beginSeqNo; i < endSeqNo; i++) {
final Message heartbeat =
messageFactory.create(sessionID.getBeginString(),
MsgType.HEARTBEAT);
initializeHeader(heartbeat.getHeader());
heartbeat.getHeader().setInt(MsgSeqNum.FIELD, i);
messages.add(heartbeat.toString());
}
} else {
throw e;
}
}
int msgSeqNum = 0;
int begin = 0;
* int current = beginSeqNo; // current = 641*
boolean appMessageJustSent = false;
for (final String message : messages) {
appMessageJustSent = false;
final Message msg;
try {
// QFJ-626
msg = parseMessage(message);
* msgSeqNum = msg.getHeader().getInt(MsgSeqNum.FIELD); //
msgSeqNum = 646*
} catch (final Exception e) {
getLog().onErrorEvent(
"Error handling ResendRequest: failed to parse
message (" + e.getMessage()
+ "): " + message);
// Note: a SequenceReset message will be generated to fill
the gap
continue;
}
* if ((current != msgSeqNum) && begin == 0) { begin =
current; }*
final String msgType = msg.getHeader().getString(MsgType.FIELD);
if (MessageUtils.isAdminMessage(msgType) &&
!forceResendWhenCorruptedStore) {
if (begin == 0) {
begin = msgSeqNum;
}
} else {
initializeResendFields(msg);
*if (resendApproved(msg)) { if (begin != 0) {
generateSequenceReset(receivedMessage, begin, msgSeqNum);
} getLog().onEvent("Resending message: " +
msgSeqNum); send(msg.toString());
begin = 0; appMessageJustSent = true;*
} else {
if (begin == 0) {
begin = msgSeqNum;
}
}
}
current = msgSeqNum + 1;
}
Best regards.
Christoph John <chr...@ma...> 于2021年3月25日周四 下午8:36写道:
> Who owns the other side? Is it also a QFJ engine?
> BTW your order in your mail is wrong. Based on field 52/SendingTime the
> ExecReport with seqnum 646 is resent first and then the SequenceReset is
> sent out. That is also the order I would expect.
> From briefly looking at it it looks as if the opposing side does not
> consider the PossDup flag that is set on the resent message with seqnum 646
> and does incorrectly report it as too low.
>
> Cheers,
> Chris.
>
>
> On 25.03.21 09:41, charles meng wrote:
>
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> Hi guys:
>
> I encountered a very strange problem. I just want to simulate a scenario
> where the sequence number exceeds the expected sequence number to trigger
> resend, but every time I receive an unexpected logout message. The detailed
> information is as follows:
>
> My service is in the role of Initiatator.
> Version:quickfix:2.1.1, FIX:FIX50SP2
>
> Initiator senderSeqNo:640
>
> 1, Initiator sends a request with a higher sequence number than expected:
> 8=FIXT.1.1^9=331^35=8^34=646^49=test1^52=20210325-08:23:21.810^56=TEST^1=108331^14=0^15=USD^17=1115569_1615646513221_927^22=971^37=1115569^38=1^39=0^40=4^44=290.2^48=BCH/USD^54=1^55=BCHUSD^59=1^60=20210313-14:41:53.099^150=0^151=1^167=CRYPTSPOT^423=3^460=15^581=1^965=1^1084=4^1138=0^453=2^448=MATX^447=G^452=22^448=MEHSAG1601PIND90805^447=D^452=3^10=219^
>
> 2, Initiator receives the resend
> request:8=FIXT.1.1^9=73^35=2^34=453^49=TEST^52=20210325-08:23:21.814^56=test1^369=640^7=641^16=0^10=029^
>
> 3, Initiator sends a sequenceReset
> request:8=FIXT.1.1^9=98^35=4^34=641^43=Y^49=test1^52=20210325-08:23:21.832^56=TEST^122=20210325-08:23:21.831^36=646^123=Y^10=053^
>
> 4, The Initiator resends the first message (because this is a simulated
> scenario that exceeds the expected seqNum, so there is no other data
> between 641 and
> 646):8=FIXT.1.1^9=362^35=8^34=646^43=Y^49=test1^52=20210325-08:23:21.830^56=TEST^122=20210325-08:23:21.810^1=108331^14=0^15=USD^17=1115569_1615646513221_927^22=971^37=1115569^38=1^39=0^40=4^44=290.2^48=BCH/USD^54=1^55=BCHUSD^59=1^60=20210313-14:41:53.099^150=0^151=1^167=CRYPTSPOT^423=3^460=15^581=1^965=1^1084=4^1138=0^453=2^448=MATX^447=G^452=22^448=MEHSAG1601PIND90805^447=D^452=3^10=217^
>
> 4, Initiator receives Logout
> message:8=FIXT.1.1^9=121^35=5^34=454^49=TEST^52=20210325-08:23:21.837^56=test^369=646^1128=9^58=MsgSeqNum
> too low, expecting 647 but received 646^10=248^
>
>
> Thanks in advance!
>
>
>
> _______________________________________________
> Quickfixj-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
>
> --
> Christoph John
> Software Engineering
> T +49 241 557...@ma...
>
> MACD GmbH
> Oppenhoffallee 103
> 52066 Aachen, Germanywww.macd.com
>
> Amtsgericht Aachen: HRB 8151
> Ust.-Id: DE 813021663
> Geschäftsführer: George Macdonald
>
>
|