Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
707 views
in Technique[技术] by (71.8m points)

fix protocol - What causes the "Disconnecting: Encountered END_OF_STREAM" session message in QuickFIX/J?

I am using QuickFIX/J version 1.6.4 within Apache Camel 2.17.0 and I get the session message Disconnecting: Encountered END_OF_STREAM. It is not an error, but in my case it leads to an unintentional Logoff.

What circumstances can lead to this message and how do I analyze which circumstance in my case is the cause?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since the accepted answer covers only an application specific behaviour I am going to name some of the possible causes for the END_OF_STREAM event.

Basically it is kind of like the "connection reset by peer" event of a TCP connection. Meaning that the connection went down without cleanly ending it with a Logout message.

Network related things aside, this can occur whenever the counterparty decides to not send a Logout. Most of the time the reason they are not sending a Logout is due to security, i.e. the counterparty does not want to disclose information about their system.

Examples:

  • SSL certificate mismatch
  • unknown CompIDs or Session (i.e. CompID or FIX version mismatch)
  • duplicate CompIDs (as it was the case in this specific question)
  • sequence number too low (although a decent FIX engine will send a Logout indicating this)

From the FIX spec (FIX Session Protocol, FIX Session-level Test Cases and Expected Behaviors):

When to send a Logout vs. when to just disconnect

In general a Logout message should always be sent prior to shutting down a connection. If the Logout is being sent due to an error condition, the Text field of the Logout should provide a descriptive reason, so that operational support of the remote FIX system can diagnosis the problem.

There are exceptions, when it is recommended that a Logout message not be sent, these include:

? If during a logon either the SenderCompID, TargetCompID or IP address of the session initiator is invalid, it is recommended that the session be immediately terminated and no Logout message sent. This login attempt might be an unauthorized attempt to break into your system; hence one does not want to divulge any information about one’s FIX system, such as: which SenderCompID/TargetCompID values are valid or which version of FIX is supported.

? If during a Logon one receives a second connection attempt while a valid FIX session is already underway for that same SenderCompID, it is recommended that the session acceptor immediately terminate the second connection attempt and not send a Logout message. Sending a Logout message runs the risk of interfering with and possibly adversely affecting the current active FIX connection. For example, in some FIX system implementations, sending a Logout message might consume a sequence number that would cause an out of sequence condition for the established FIX session.

In all other cases, if sending a Logout does not create risk or violate security, a Logout message should be sent with a descriptive text message.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...