Quantcast

QF/j initiator doesn"t reconnect

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

QF/j initiator doesn"t reconnect

Caranthir
hello,

I have developed my fix initiator but when the connection drops, my qf/j client doesn't try to reconnect. it just logs out and waits forever. I think, it has something to do with : Disconnecting: Socket exception (/************:443): java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen

I would appreciate any help.

Thanks
Jul 29, 2015 12:33:21 PM com.xxx.ice.IceApplication fromAdmin
Information: Heartbeat received. Writing to File
Jul 29, 2015 12:33:21 PM com.xxx.ice.IceApplication fromAdmin
Information: fromadmin
Jul 29, 2015 12:33:21 PM com.xxx.ice.IceApplication toAdmin
Information: toAdmin
Jul 29, 2015 12:33:21 PM quickfix.Session send
Information: FIX.4.4:4396/1->ICE: 8=FIX.4.49=5535=034=549=439650=152=20150729-10:33:21.68256=ICE10=089
Jul 29, 2015 12:33:51 PM com.xxx.ice.IceApplication toAdmin
Information: toAdmin
Jul 29, 2015 12:33:51 PM quickfix.Session send
Information: FIX.4.4:4396/1->ICE: 8=FIX.4.49=5535=034=649=439650=152=20150729-10:33:51.96356=ICE10=095
Jul 29, 2015 12:34:06 PM com.xxx.ice.IceApplication toAdmin
Information: toAdmin
Jul 29, 2015 12:34:06 PM quickfix.Session send
Information: FIX.4.4:4396/1->ICE: 8=FIX.4.49=6435=134=749=439650=152=20150729-10:34:06.96456=ICE112=TEST10=117
Jul 29, 2015 12:34:06 PM org.slf4j.impl.JDK14LoggerAdapter fillCallerData
Information: FIX.4.4:4396/1->ICE: Sent test request TEST
Jul 29, 2015 12:34:11 PM quickfix.SLF4JLog logError
Schwerwiegend: FIX.4.4:4396/1->ICE: Disconnecting: Socket exception (/************:443): java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
Jul 29, 2015 12:34:11 PM com.xxx.ice.IceApplication onLogout
Information: onlogout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Kimpton, C (Chris)
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Hello Caranthir,

It works for us :)

Can you provide a simple example and/or the configuration settings used that have the issue?

Cheers,
Chris

-----Original Message-----
From: Caranthir [mailto:[hidden email]]
Sent: 29 July 2015 11:59
To: [hidden email]
Subject: [Quickfixj-users] QF/j initiator doesn"t reconnect

QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


hello,

I have developed my fix initiator but when the connection drops, my qf/j client doesn't try to reconnect. it just logs out and waits forever. I think, it has something to do with : Disconnecting: Socket exception
(/************:443): java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen

I would appreciate any help.

Thanks




--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
_________________________________________________________________________________

This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing.
_________________________________________________________________________________

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
This is my config file
[DEFAULT]# Settings which apply to all the Sessions.
ConnectionType=initiator
LogonTimeout=30
FileLogPath=C:\Work\QuickFIXJ\logs
SocketUseSSL=Y
[SESSION]# Settings specifically for one session
AllowUnknownMsgFields=Y
ValidateFieldsOutOfOrder=N
ValidateUserDefinedFields=N 
ValidateFieldsHaveValues=N 
ValidateUnorderedGroupFields=N
ReconnectInterval=5
ResetOnLogout=Y
ResetOnLogon=Y
ResetOnDisconnect=Y
BeginString=FIX.4.4
SenderCompID=4396
SenderSubID= 1
TargetCompID=ICE
StartTime=05:30:00
EndTime=23:30:00
HeartBtInt=30
CheckLatency=N
SocketConnectPort=443
SocketConnectHost=**********
UseDataDictionary=Y
FileLogHeartbeats=Y
SocketUseSSL=Y
ScreenLogEvents=N
FileStorePath=C:\Work\QuickFIXJ\sessioninfo

And this is my main file, where the program is started:

private static final CountDownLatch shutdownLatch = new CountDownLatch(1);

	private static final Logger log = LoggerFactory.getLogger(Ice.class);
	private static Ice ice;
	private static boolean initiatorStarted = false;
	private static Initiator initiator = null;

	public Ice(String[] args) throws Exception {
		InputStream inputStream = null;
		if (args.length == 0) {
			inputStream = Ice.class.getResourceAsStream("ice.cfg");
		} else if (args.length == 1) {
			inputStream = new FileInputStream(args[0]);
		}
		if (inputStream == null) {
			System.out.println("usage: " + Ice.class.getName() + " [configFile].");
			return;
		}
		SessionSettings settings = new SessionSettings(inputStream);
		inputStream.close();

		IceApplication application = new IceApplication();
		MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);
		LogFactory logFactory = new ScreenLogFactory(true, true, true, true);
		//SLF4JLogFactory  logFactory = new SLF4JLogFactory(settings);

		MessageFactory messageFactory = new DefaultMessageFactory();

		initiator = new SocketInitiator(application, messageStoreFactory, settings, logFactory,
				messageFactory);
	}

	public synchronized static void logon() {
		if (!initiatorStarted) {
			try {
				initiator.start();
				initiatorStarted = true;
			} catch (Exception e) {
				log.error("Logon failed", e);
			}
		} else {
			for (SessionID sessionId : initiator.getSessions()) {
				Session.lookupSession(sessionId).logon();
			}
		}
	}

	public void logout() {
		for (SessionID sessionId : initiator.getSessions()) {
			Session.lookupSession(sessionId).logout("user requested");
		}
	}

	public void stop() {
		shutdownLatch.countDown();
	}

	public static Ice get() {
		return ice;
	}

	public static void main(String[] args) throws Exception {
		ice = new Ice(args);
		Ice.logon();

		shutdownLatch.await();
	}

In my application file I just request a TradeCaptureReport and a security definition, which work fine. Then i listen to live updates which also works fine. But after closing the connection. It doesnt try to reconnect.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

kimptoc
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi,

Nothing is showing - did you attach some files, maybe they got stripped out?

Cheers.

On 29 July 2015 at 12:52, Caranthir <[hidden email]> wrote:
QuickFIX/J Documentation: <a href="http://www.quickfixj.org/documentation/ QuickFIX/J" rel="noreferrer" target="_blank">http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


This is my config file


And this is my main file, where the program is started:



In my application file I just request a TradeCaptureReport and a security
definition, which work fine. Then i listen to live updates which also works
fine. But after closing the connection. It doesnt try to reconnect.

Thanks



--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579122.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users


------------------------------------------------------------------------------

_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
If you view it in the forum context, you will see it.
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579122.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
Now I can reproduce the problem. I have written a simple program that just logs in the server. I disconnect the computer from the internet and it doesn"t try to reconnect.
Main class:

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;

import javax.swing.JFrame;
import javax.swing.UIManager;

import org.quickfixj.jmx.JmxExporter;

import quickfix.DefaultMessageFactory;
import quickfix.FileStoreFactory;
import quickfix.Initiator;
import quickfix.LogFactory;
import quickfix.MessageFactory;
import quickfix.MessageStoreFactory;
import quickfix.ScreenLogFactory;
import quickfix.Session;
import quickfix.SessionID;
import quickfix.SessionSettings;
import quickfix.SocketInitiator;


public class Main {
       

    private static final CountDownLatch shutdownLatch = new CountDownLatch(1);

    private static Main banzai;
    private boolean initiatorStarted = false;
    private Initiator initiator = null;
    private JFrame frame = null;

    public Main(String[] args) throws Exception {
        InputStream inputStream = null;
        if (args.length == 0) {
            inputStream = Main.class.getResourceAsStream("banzai.cfg");
        } else if (args.length == 1) {
            inputStream = new FileInputStream(args[0]);
        }
        if (inputStream == null) {
            System.out.println("usage: " + Main.class.getName() + " [configFile].");
            return;
        }
        SessionSettings settings = new SessionSettings(inputStream);
        inputStream.close();

        boolean logHeartbeats = Boolean.valueOf(System.getProperty("logHeartbeats", "true"));

        MainApplication application = new MainApplication();
        MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);
        LogFactory logFactory = new ScreenLogFactory(true, true, true, logHeartbeats);
        MessageFactory messageFactory = new DefaultMessageFactory();

        initiator = new SocketInitiator(application, messageStoreFactory, settings, logFactory,
                messageFactory);

        JmxExporter exporter = new JmxExporter();
        exporter.register(initiator);

    }

    public synchronized void logon() {
        if (!initiatorStarted) {
            try {
                initiator.start();
                initiatorStarted = true;
            } catch (Exception e) {
                //log.error("Logon failed", e);
            }
        } else {
            for (SessionID sessionId : initiator.getSessions()) {
                Session.lookupSession(sessionId).logon();
            }
        }
    }

    public void logout() {
        for (SessionID sessionId : initiator.getSessions()) {
            Session.lookupSession(sessionId).logout("user requested");
        }
    }

    public void stop() {
        shutdownLatch.countDown();
    }

    public JFrame getFrame() {
        return frame;
    }

    public static Main get() {
        return banzai;
    }

    public static void main(String[] args) throws Exception {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
       
           // log.info(e.getMessage(), e);
        }
        banzai = new Main(args);
        if (!System.getProperties().containsKey("openfix")) {
            banzai.logon();
        }
        shutdownLatch.await();
    }

}

MainApplication

import java.util.HashMap;
import java.util.HashSet;

import javax.swing.SwingUtilities;

import quickfix.Application;
import quickfix.DefaultMessageFactory;
import quickfix.DoNotSend;
import quickfix.FieldNotFound;
import quickfix.IncorrectDataFormat;
import quickfix.IncorrectTagValue;
import quickfix.RejectLogon;
import quickfix.SessionID;
import quickfix.UnsupportedMessageType;
import quickfix.field.BusinessRejectReason;
import quickfix.field.DeliverToCompID;
import quickfix.field.ExecID;
import quickfix.field.MsgType;
import quickfix.field.SessionRejectReason;

public class MainApplication implements Application {
    private final DefaultMessageFactory messageFactory = new DefaultMessageFactory();
    private boolean isAvailable = true;
    private boolean isMissingField;

    static private final HashMap<SessionID, HashSet<ExecID>> execIDs = new HashMap<SessionID, HashSet<ExecID>>();

    public MainApplication() {
    }

    public void onCreate(SessionID sessionID) {
    }

    public void onLogon(SessionID sessionID) {
       // observableLogon.logon(sessionID);
    }

    public void onLogout(SessionID sessionID) {
      //  observableLogon.logoff(sessionID);
    }

    public void toAdmin(quickfix.Message msg, SessionID sessionID) {
    String msgType;
                try {
                        msgType = msg.getHeader().getString(MsgType.FIELD);
                        if(MsgType.LOGON.compareTo(msgType) == 0)
                        {
                                msg.setString(quickfix.field.Username.FIELD, "*****");
                                msg.setString(quickfix.field.Password.FIELD, "***");
                        }
                } catch (FieldNotFound e) {
                        e.printStackTrace();
                }
    }

    public void toApp(quickfix.Message message, SessionID sessionID) throws DoNotSend {
    }

    public void fromAdmin(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
            IncorrectDataFormat, IncorrectTagValue, RejectLogon {
    }

    public void fromApp(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
            IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType {
        try {
            SwingUtilities.invokeLater(new MessageProcessor(message, sessionID));
        } catch (Exception e) {
        }
    }

    public class MessageProcessor implements Runnable {
        private final quickfix.Message message;
        private final SessionID sessionID;

        public MessageProcessor(quickfix.Message message, SessionID sessionID) {
            this.message = message;
            this.sessionID = sessionID;
        }

        public void run() {
            try {
                MsgType msgType = new MsgType();
                if (isAvailable) {
                   /* if (isMissingField) {
                        // For OpenFIX certification testing
                        sendBusinessReject(message, BusinessRejectReason.CONDITIONALLY_REQUIRED_FIELD_MISSING, "Conditionally required field missing");
                    }
                    else if (message.getHeader().isSetField(DeliverToCompID.FIELD)) {
                        // This is here to support OpenFIX certification
                        sendSessionReject(message, SessionRejectReason.COMPID_PROBLEM);
                    } else if (message.getHeader().getField(msgType).valueEquals("8")) {
                        executionReport(message, sessionID);
                    } else if (message.getHeader().getField(msgType).valueEquals("9")) {
                        cancelReject(message, sessionID);
                    } else {
                        sendBusinessReject(message, BusinessRejectReason.UNSUPPORTED_MESSAGE_TYPE,
                                "Unsupported Message Type");
                    }*/
                System.out.println("dfdsf");
                } else {
                   /* sendBusinessReject(message, BusinessRejectReason.APPLICATION_NOT_AVAILABLE,
                            "Application not available");*/
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

Config File :
[DEFAULT]# Settings which apply to all the Sessions.
ConnectionType=initiator
LogonTimeout=30
FileLogPath=C:\Work\QuickFIXJ\logs
SocketUseSSL=Y
[SESSION]# Settings specifically for one session
AllowUnknownMsgFields=Y
ValidateFieldsOutOfOrder=N
ValidateUserDefinedFields=N
ValidateFieldsHaveValues=N
ValidateUnorderedGroupFields=N
ReconnectInterval=5
ResetOnLogout=Y
ResetOnLogon=Y
ResetOnDisconnect=Y
BeginString=FIX.4.4
SenderCompID=4396
SenderSubID= 1
TargetCompID=ICE
StartTime=05:30:00
EndTime=23:30:00
HeartBtInt=30
CheckLatency=N
SocketConnectPort=443
SocketConnectHost=**********
UseDataDictionary=Y
FileLogHeartbeats=Y
SocketUseSSL=Y
ScreenLogEvents=N
FileStorePath=C:\Work\QuickFIXJ\sessioninfo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Kimpton, C (Chris)
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Thanks - I have run this against a mock acceptor I have.

When I stop my mock acceptor, it tries to reconnect and when I restart it - it successfully connects- see logs below.

Perhaps the way you disconnect from the internet is a factor.


14:23:38:058|TH1 INFO: [FIXT.1.1:target-em-incoming->sender-em-incoming] daily, 05:30:00-UTC - 23:30:00-UTC <20150730-13:23:38, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Session FIXT.1.1:target-em-incoming->sender-em-incoming schedule is daily, 05:30:00-UTC - 23:30:00-UTC) <20150730-13:23:38, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Created session: FIXT.1.1:target-em-incoming->sender-em-incoming)
14:23:38:087|TH1 INFO: Socket option: SocketTcpNoDelay=true
14:23:38:087|TH1 INFO: Socket option: SocketSynchronousWrites=false
14:23:38:087|TH1 INFO: Socket option: SocketSynchronousWriteTimeout=30000
14:23:38:150|TH1 INFO: [FIXT.1.1:target-em-incoming->sender-em-incoming] [localhost/127.0.0.1:5566]
14:23:38:151|TH1 INFO: SessionTimer started
14:23:38:152|TH2 INFO: Started QFJ Message Processor
14:23:38:163|TH3 INFO: MINA session created for FIXT.1.1:target-em-incoming->sender-em-incoming: local=/127.0.0.1:23396, class org.apache.mina.transport.socket.nio.NioSocketSession, remote=localhost/127.0.0.1:5566 <20150730-13:23:39, FIXT.1.1:target-em-incoming->sender-em-incoming, outgoing> (8=FIXT.1.1 9=104 35=A 34=1 49=target-em-incoming 52=20150730-13:23:39.208 56=sender-em-incoming 98=0 108=30 141=Y 1137=9 10=242 )
<20150730-13:23:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Initiated logon request) <20150730-13:23:39, FIXT.1.1:target-em-incoming->sender-em-incoming, incoming> (8=FIXT.1.1 9=104 35=A 34=1 49=sender-em-incoming 52=20150730-13:23:39.236 56=target-em-incoming 98=0 108=30 141=Y 1137=9 10=243 )
14:23:39:566|TH3 INFO: Setting DefaultApplVerID (1137=9) from Logon <20150730-13:23:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1) <20150730-13:23:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Received logon) <20150730-13:24:09, FIXT.1.1:target-em-incoming->sender-em-incoming, incoming> (8=FIXT.1.1 9=79 35=0 34=2 49=sender-em-incoming 52=20150730-13:24:09.646 56=target-em-incoming 10=056 )
<20150730-13:24:09, FIXT.1.1:target-em-incoming->sender-em-incoming, outgoing> (8=FIXT.1.1 9=79 35=0 34=2 49=target-em-incoming 52=20150730-13:24:09.649 56=sender-em-incoming 10=059 )
<20150730-13:24:39, FIXT.1.1:target-em-incoming->sender-em-incoming, incoming> (8=FIXT.1.1 9=79 35=0 34=3 49=sender-em-incoming 52=20150730-13:24:39.674 56=target-em-incoming 10=061 )
<20150730-13:24:39, FIXT.1.1:target-em-incoming->sender-em-incoming, outgoing> (8=FIXT.1.1 9=79 35=0 34=3 49=target-em-incoming 52=20150730-13:24:39.679 56=sender-em-incoming 10=066 )
***[stopped acceptor here]
<20150730-13:25:07, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (Disconnecting: Socket exception (localhost/127.0.0.1:5566): java.io.IOException: An existing connection was forcibly closed by the remote host) <20150730-13:25:09, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds)) <20150730-13:25:14, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds)) <20150730-13:25:19, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds))
***[trying to connect]
<20150730-13:25:24, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds)) <20150730-13:25:29, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds)) <20150730-13:25:34, FIXT.1.1:target-em-incoming->sender-em-incoming, error> (java.net.ConnectException: java.net.ConnectException: Connection refused: no further information (Next retry in 5000 milliseconds))
***[started acceptor here]
14:25:38:459|TH3 INFO: MINA session created for FIXT.1.1:target-em-incoming->sender-em-incoming: local=/127.0.0.1:23515, class org.apache.mina.transport.socket.nio.NioSocketSession, remote=localhost/127.0.0.1:5566 <20150730-13:25:39, FIXT.1.1:target-em-incoming->sender-em-incoming, outgoing> (8=FIXT.1.1 9=104 35=A 34=1 49=target-em-incoming 52=20150730-13:25:39.288 56=sender-em-incoming 98=0 108=30 141=Y 1137=9 10=252 )
<20150730-13:25:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Initiated logon request) <20150730-13:25:39, FIXT.1.1:target-em-incoming->sender-em-incoming, incoming> (8=FIXT.1.1 9=104 35=A 34=1 49=sender-em-incoming 52=20150730-13:25:39.397 56=target-em-incoming 98=0 108=30 141=Y 1137=9 10=253 )
14:25:39:403|TH3 INFO: Setting DefaultApplVerID (1137=9) from Logon <20150730-13:25:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1) <20150730-13:25:39, FIXT.1.1:target-em-incoming->sender-em-incoming, event> (Received logon)

-----Original Message-----
From: Caranthir [mailto:[hidden email]]
Sent: 30 July 2015 13:19
To: [hidden email]
Subject: Re: [Quickfixj-users] QF/j initiator doesn"t reconnect

QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Now I can reproduce the problem. I have written a simple program that just logs in the server. I disconnect the computer from the internet and it doesn"t try to reconnect.
Main class:

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;

import javax.swing.JFrame;
import javax.swing.UIManager;

import org.quickfixj.jmx.JmxExporter;

import quickfix.DefaultMessageFactory;
import quickfix.FileStoreFactory;
import quickfix.Initiator;
import quickfix.LogFactory;
import quickfix.MessageFactory;
import quickfix.MessageStoreFactory;
import quickfix.ScreenLogFactory;
import quickfix.Session;
import quickfix.SessionID;
import quickfix.SessionSettings;
import quickfix.SocketInitiator;


public class Main {
       

    private static final CountDownLatch shutdownLatch = new CountDownLatch(1);

    private static Main banzai;
    private boolean initiatorStarted = false;
    private Initiator initiator = null;
    private JFrame frame = null;

    public Main(String[] args) throws Exception {
        InputStream inputStream = null;
        if (args.length == 0) {
            inputStream = Main.class.getResourceAsStream("banzai.cfg");
        } else if (args.length == 1) {
            inputStream = new FileInputStream(args[0]);
        }
        if (inputStream == null) {
            System.out.println("usage: " + Main.class.getName() + "
[configFile].");
            return;
        }
        SessionSettings settings = new SessionSettings(inputStream);
        inputStream.close();

        boolean logHeartbeats =
Boolean.valueOf(System.getProperty("logHeartbeats", "true"));

        MainApplication application = new MainApplication();
        MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);
        LogFactory logFactory = new ScreenLogFactory(true, true, true, logHeartbeats);
        MessageFactory messageFactory = new DefaultMessageFactory();

        initiator = new SocketInitiator(application, messageStoreFactory, settings, logFactory,
                messageFactory);

        JmxExporter exporter = new JmxExporter();
        exporter.register(initiator);

    }

    public synchronized void logon() {
        if (!initiatorStarted) {
            try {
                initiator.start();
                initiatorStarted = true;
            } catch (Exception e) {
                //log.error("Logon failed", e);
            }
        } else {
            for (SessionID sessionId : initiator.getSessions()) {
                Session.lookupSession(sessionId).logon();
            }
        }
    }

    public void logout() {
        for (SessionID sessionId : initiator.getSessions()) {
            Session.lookupSession(sessionId).logout("user requested");
        }
    }

    public void stop() {
        shutdownLatch.countDown();
    }

    public JFrame getFrame() {
        return frame;
    }

    public static Main get() {
        return banzai;
    }

    public static void main(String[] args) throws Exception {
        try {
           
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
       
           // log.info(e.getMessage(), e);
        }
        banzai = new Main(args);
        if (!System.getProperties().containsKey("openfix")) {
            banzai.logon();
        }
        shutdownLatch.await();
    }

}

MainApplication

import java.util.HashMap;
import java.util.HashSet;

import javax.swing.SwingUtilities;

import quickfix.Application;
import quickfix.DefaultMessageFactory;
import quickfix.DoNotSend;
import quickfix.FieldNotFound;
import quickfix.IncorrectDataFormat;
import quickfix.IncorrectTagValue;
import quickfix.RejectLogon;
import quickfix.SessionID;
import quickfix.UnsupportedMessageType;
import quickfix.field.BusinessRejectReason;
import quickfix.field.DeliverToCompID;
import quickfix.field.ExecID;
import quickfix.field.MsgType;
import quickfix.field.SessionRejectReason;

public class MainApplication implements Application {
    private final DefaultMessageFactory messageFactory = new DefaultMessageFactory();
    private boolean isAvailable = true;
    private boolean isMissingField;

    static private final HashMap<SessionID, HashSet&lt;ExecID>> execIDs = new HashMap<SessionID, HashSet&lt;ExecID>>();

    public MainApplication() {
    }

    public void onCreate(SessionID sessionID) {
    }

    public void onLogon(SessionID sessionID) {
       // observableLogon.logon(sessionID);
    }

    public void onLogout(SessionID sessionID) {
      //  observableLogon.logoff(sessionID);
    }

    public void toAdmin(quickfix.Message msg, SessionID sessionID) {
    String msgType;
                try {
                        msgType = msg.getHeader().getString(MsgType.FIELD);
                        if(MsgType.LOGON.compareTo(msgType) == 0)
                        {
                                msg.setString(quickfix.field.Username.FIELD, "*****");
                                msg.setString(quickfix.field.Password.FIELD, "***");
                        }
                } catch (FieldNotFound e) {
                        e.printStackTrace();
                }
    }

    public void toApp(quickfix.Message message, SessionID sessionID) throws DoNotSend {
    }

    public void fromAdmin(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
            IncorrectDataFormat, IncorrectTagValue, RejectLogon {
    }

    public void fromApp(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
            IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType {
        try {
            SwingUtilities.invokeLater(new MessageProcessor(message, sessionID));
        } catch (Exception e) {
        }
    }

    public class MessageProcessor implements Runnable {
        private final quickfix.Message message;
        private final SessionID sessionID;

        public MessageProcessor(quickfix.Message message, SessionID
sessionID) {
            this.message = message;
            this.sessionID = sessionID;
        }

        public void run() {
            try {
                MsgType msgType = new MsgType();
                if (isAvailable) {
                   /* if (isMissingField) {
                        // For OpenFIX certification testing
                        sendBusinessReject(message, BusinessRejectReason.CONDITIONALLY_REQUIRED_FIELD_MISSING, "Conditionally required field missing");
                    }
                    else if
(message.getHeader().isSetField(DeliverToCompID.FIELD)) {
                        // This is here to support OpenFIX certification
                        sendSessionReject(message, SessionRejectReason.COMPID_PROBLEM);
                    } else if
(message.getHeader().getField(msgType).valueEquals("8")) {
                        executionReport(message, sessionID);
                    } else if
(message.getHeader().getField(msgType).valueEquals("9")) {
                        cancelReject(message, sessionID);
                    } else {
                        sendBusinessReject(message, BusinessRejectReason.UNSUPPORTED_MESSAGE_TYPE,
                                "Unsupported Message Type");
                    }*/
                System.out.println("dfdsf");
                } else {
                   /* sendBusinessReject(message, BusinessRejectReason.APPLICATION_NOT_AVAILABLE,
                            "Application not available");*/
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

Config File :
[DEFAULT]# Settings which apply to all the Sessions.
ConnectionType=initiator
LogonTimeout=30
FileLogPath=C:\Work\QuickFIXJ\logs
SocketUseSSL=Y
[SESSION]# Settings specifically for one session AllowUnknownMsgFields=Y ValidateFieldsOutOfOrder=N ValidateUserDefinedFields=N ValidateFieldsHaveValues=N ValidateUnorderedGroupFields=N
ReconnectInterval=5
ResetOnLogout=Y
ResetOnLogon=Y
ResetOnDisconnect=Y
BeginString=FIX.4.4
SenderCompID=4396
SenderSubID= 1
TargetCompID=ICE
StartTime=05:30:00
EndTime=23:30:00
HeartBtInt=30
CheckLatency=N
SocketConnectPort=443
SocketConnectHost=**********
UseDataDictionary=Y
FileLogHeartbeats=Y
SocketUseSSL=Y
ScreenLogEvents=N
FileStorePath=C:\Work\QuickFIXJ\sessioninfo




--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579125.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
_________________________________________________________________________________

This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing.
_________________________________________________________________________________

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
Ok now i could specify the problem. When the server is manually closed, the client knows it immediately and tries to reconnect. But when the internet is disconnected, the client knows it when it doesn't receive the heartbeat and doesn't try to reconnect.

I have tried it with the ICE Server. But i dont think that the server is important here.

Not only my implementation. I have also tried it with the sample Banzai program. I connected with banzai to the ice server. And when internet was disconnected, banzai didn't try to reconnect.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Øyvind Matheson Wergeland
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


QF/J should always reconnect as long as the session is active. You need to debug this further. Are you sure you do not log out programmatically when this happen?

What do you mean by "the Internet is disconnected"? Are you physically removing a network cable, reconfiguring a router or firewall, or something else?

What is the IO exception message on the imitator? "Connection reset by peer", "No route to host", or something else?

 -Øyvind

> Den 31. jul. 2015 kl. 12.24 skrev Caranthir <[hidden email]>:
>
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> Ok now i could specify the problem. When the server is manually closed, the
> client knows it immediately and tries to reconnect. But when the internet is
> disconnected, the client knows it when it doesn't receive the heartbeat and
> doesn't try to reconnect.
>
> I have tried it with the ICE Server. But i dont think that the server is
> important here.
>
> Not only my implementation. I have also tried it with the sample Banzai
> program. I connected with banzai to the ice server. And when internet was
> disconnected, banzai didn't try to reconnect.
>
>
>
> --
> View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579127.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
You can see in the first message the exception i am getting:
<20150803-07:31:54, FIX.4.4:4396/1->ICE, error> (Disconnecting: Socket exception (/**********): java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen)
Aug 03, 2015 9:31:54 AM com.verbund.ice.IceApplication onLogout
Information: onlogout


It does log out but i don't think i am doing it. It logs out itself. I have also post the source code to this topic. Can you have a look at it?
And yes i am physically removing the network cable.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Øyvind Matheson Wergeland
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi,

This translates to "An existing connection was closed by the remote host" - is this the same as "Connection closed by peer" using an English locale?

Unfortunately, I do not have the time to study your code. Anyway, in the long run, you will benefit from debugging this yourself.

Do you have an onAdmin handler?

Also, check the following configuration variables:
ReconnectInterval
DisconnectOnError

ContinueInitializationOnError


Best regards

Øyvind Matheson Wergeland


On 08/03/2015 09:35 AM, Caranthir wrote:
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


You can see in the first message the exception i am getting:
<20150803-07:31:54, FIX.4.4:4396/1->ICE, error> (Disconnecting: Socket
exception (/**********): java.io.IOException: Eine vorhandene Verbindung
wurde vom Remotehost geschlossen)
Aug 03, 2015 9:31:54 AM com.verbund.ice.IceApplication onLogout
Information: onlogout


It does log out but i don't think i am doing it. It logs out itself. I have
also post the source code to this topic. Can you have a look at it? 
And yes i am physically removing the network cable.



--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579136.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
"

------------------------------------------------------------------------------

_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Colin DuPlantis
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Can you elaborate on whether you see this "closed by remote host" exception once or repeatedly? This exception implies that the server you connected to is closing the socket, not QFJ. If you see this repeatedly, then QFJ is indeed trying to reconnect. If you see it just once, then I would check the start and end time of your session. QFJ won't try to connect if the session is past its end time.

On 8/3/15 12:50 AM, Øyvind Matheson Wergeland wrote:
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/




Hi,

This translates to "An existing connection was closed by the remote host" - is this the same as "Connection closed by peer" using an English locale?

Unfortunately, I do not have the time to study your code. Anyway, in the long run, you will benefit from debugging this yourself.

Do you have an onAdmin handler?

Also, check the following configuration variables:
ReconnectInterval
DisconnectOnError

ContinueInitializationOnError


Best regards

Øyvind Matheson Wergeland


On 08/03/2015 09:35 AM, Caranthir wrote:
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


You can see in the first message the exception i am getting:
<20150803-07:31:54, FIX.4.4:4396/1->ICE, error> (Disconnecting: Socket
exception (/**********): java.io.IOException: Eine vorhandene Verbindung
wurde vom Remotehost geschlossen)
Aug 03, 2015 9:31:54 AM com.verbund.ice.IceApplication onLogout
Information: onlogout


It does log out but i don't think i am doing it. It logs out itself. I have
also post the source code to this topic. Can you have a look at it? 
And yes i am physically removing the network cable.



--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579136.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
"


------------------------------------------------------------------------------


_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users

-- 
Colin DuPlantis
Chief Architect, Marketcetera
Download, Run, Trade
800.819.2928 x101 +1.541.306.6556
http://www.marketcetera.org

------------------------------------------------------------------------------

_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
I am seeing this error just once. It doesn't try to reconnect. Because when i plug in the networkcable again, it doesn't establish a connection with the server.

@Øyvind Matheson Wergeland

I don't have an onAdmin Handler. I have checked the configuration as you said but can't recognize any mistakes.

I am starting to think that it is a bug. Because qf/j thinks that the connection was closed by the remote server, when it cannot get any more heartbeat messages.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Colin DuPlantis
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


What version are you working with?

On 8/3/15 6:23 AM, Caranthir wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> I am seeing this error just once. It doesn't try to reconnect. Because when i
> plug in the networkcable again, it doesn't establish a connection with the
> server.
>
> @Øyvind Matheson Wergeland
>
> I don't have an onAdmin Handler. I have checked the configuration as you
> said but can't recognize any mistakes.
>
> I am starting to think that it is a bug. Because qf/j thinks that the
> connection was closed by the remote server, when it cannot get any more
> heartbeat messages.
>
>
>
> --
> View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579139.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

--
Colin DuPlantis
Chief Architect, Marketcetera
Download, Run, Trade
800.819.2928 x101 +1.541.306.6556
http://www.marketcetera.org


------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
1.6.0
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
I now tested it with a dummy server and client and unplugged the network cable and quickfix j did try to econnect. so it is not a bug.

The only difference between connecting to dummy server and ice server is almost only my onAdmin Method where i set the username and password.

                String msgType;
                System.out.println("toadmin");

                try {
                        msgType = msg.getHeader().getString(MsgType.FIELD);

                        if(MsgType.LOGON.compareTo(msgType) == 0)
                        {
                                msg.setString(quickfix.field.Username.FIELD, username);
                                msg.setString(quickfix.field.Password.FIELD, password);
                        }
                } catch (Exception e) {
                        e.printStackTrace();
                }


Do you think, this may be importan?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Colin DuPlantis
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


If you take these lines out, does it make a difference? Doesn't matter
if you're able to connect or not, just tying to see if it makes a
difference.

On 8/3/15 7:58 AM, Caranthir wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> I now tested it with a dummy server and client and unplugged the network
> cable and quickfix j did try to econnect. so it is not a bug.
>
> The only difference between connecting to dummy server and ice server is
> almost only my onAdmin Method where i set the username and password.
>
> String msgType;
> System.out.println("toadmin");
>
> try {
> msgType = msg.getHeader().getString(MsgType.FIELD);
>
> if(MsgType.LOGON.compareTo(msgType) == 0)
> {
> msg.setString(quickfix.field.Username.FIELD, username);
> msg.setString(quickfix.field.Password.FIELD, password);
> }
> } catch (Exception e) {
> e.printStackTrace();
> }
>
>
> Do you think, this may be importan?
>
>
>
> --
> View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579142.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

--
Colin DuPlantis
Chief Architect, Marketcetera
Download, Run, Trade
800.819.2928 x101 +1.541.306.6556
http://www.marketcetera.org


------------------------------------------------------------------------------
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
When i take these lines out. It can"t logon  but tries to reconnect. But i need these lines to logon and after logon it doesn't try to reconnect.

Also when i connected to the dummy server, these lines were missing and it tried to reconnect also after logon when the network cable was unplugged.:

<20150803-15:04:41, FIX.4.4:4396/1->ICE, outgoing> (8=FIX.4.49=7335=A34=149=439650=152=20150803-15:04:41.94556=ICE98=0108=30141=Y10=172)
<20150803-15:04:41, FIX.4.4:4396/1->ICE, event> (Initiated logon request)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, incoming> (8=FIX.4.49=15235=549=ICE34=152=20150803-15:04:42.03356=439657=158=Missing id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and close connection.10=057)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, event> (Received logout request: Missing id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and close connection.)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, outgoing> (8=FIX.4.49=5535=534=249=439650=152=20150803-15:04:42.07656=ICE10=087)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, event> (Sent logout response)
Aug 03, 2015 5:04:42 PM quickfix.Session disconnect
INFO: [FIX.4.4:4396/1->ICE] Disconnecting: Received logout request: Missing id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and close connection.
hop
<20150803-15:04:46, FIX.4.4:4396/1->ICE, error> (java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route to host: no further information (Next retry in 5000 milliseconds))
<20150803-15:04:51, FIX.4.4:4396/1->ICE, error> (java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route to host: no further information (Next retry in 5000 milliseconds))
<20150803-15:04:56, FIX.4.4:4396/1->ICE, error> (java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route to host: no further information (Next retry in 5000 milliseconds))
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Christoph John
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi,
when QFJ does not try to reconnect, then you most probably called logout() on your Session. It will only try reconnecting after you called logon().
Could it be that you call Session.logout() in your onLogout() callback?

Cheers,
Chris.


Am 3. August 2015 17:08:23 MESZ, schrieb Caranthir <[hidden email]>:
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


When i take these lines out. It can"t logon but tries to reconnect. But i
need these lines to logon and after logon it doesn't try to reconnect.

Also when i connected to the dummy server, these lines were missing and it
tried to reconnect also after logon when the network cable was unplugged.:

<20150803-15:04:41, FIX.4.4:4396/1->ICE, outgoing>
(8=FIX.4.4 9=73 35=A 34=1 49=4396 50=1 52=20150803-15:04:41.945 56=ICE 98=0 108=30 141=Y 10=172 )
<20150803-15:04:41, FIX.4.4:4396/1->ICE, event> (Initiated logon request)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, incoming>
(8=FIX.4.4 9=152 35=5 49=ICE 34=1 52=20150803-15:04:42.033 56=4396 57=1 58=Missing
id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and close
connection. 10=057 )
<20150803-15:04:42, FIX.4.4:4396/1->ICE, event> (Received logout request:
Missing id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and
close connection.)
<20150803-15:04:42, FIX.4.4:4396/1->ICE, outgoing>
(8=FIX.4.4 9=55 35=5 34=2 49=4396 50=1 52=20150803-15:04:42.076 56=ICE 10=087 )
<20150803-15:04:42, FIX.4.4:4396/1->ICE, event> (Sent logout response)
Aug 03, 2015 5:04:42 PM quickfix.Session disconnect
INFO: [FIX.4.4:4396/1->ICE] Disconnecting: Received logout request: Missing
id tag value(s), CompId:4396 SubId:1 UserName:null, send logout and close
connection.
hop
<20150803-15:04:46, FIX.4.4:4396/1->ICE, error>
(java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route
to host: no further information (Next retry in 5000 milliseconds))
<20150803-15:04:51, FIX.4.4:4396/1->ICE, error>
(java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route
to host: no further information (Next retry in 5000 milliseconds))
<20150803-15:04:56, FIX.4.4:4396/1->ICE, error>
(java.net.NoRouteToHostException: java.net.NoRouteToHostException: No route
to host: no further information (Next retry in 5000 milliseconds))




--
View this message in context: http://quickfix-j.364392.n2.nabble.com/QF-j-initiator-doesn-t-reconnect-tp7579120p7579144.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.





Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users

------------------------------------------------------------------------------

_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: QF/j initiator doesn"t reconnect

Caranthir
Hello,

thanks for your answer but no. I am not calling any logout methods. Here I am putting a very simple version of my program where you can reproduce the problem. It would be really nice if you could have a look at it.
Configuration file:
[default]
FileStorePath=target/data/banzai
ConnectionType=initiator
SenderCompID=BANZAI
TargetCompID=ICE
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=30
ReconnectInterval=5

[session]
BeginString=FIX.4.4
SocketConnectPort=443
SocketConnectHost=****
SenderCompID=****
SenderSubID= 1
TargetCompID=ICE
ResetOnLogon=Y
SocketUseSSL=Y


Main.java

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;

import javax.swing.JFrame;
import javax.swing.UIManager;

import org.quickfixj.jmx.JmxExporter;

import quickfix.DefaultMessageFactory;
import quickfix.FileStoreFactory;
import quickfix.Initiator;
import quickfix.LogFactory;
import quickfix.MessageFactory;
import quickfix.MessageStoreFactory;
import quickfix.ScreenLogFactory;
import quickfix.Session;
import quickfix.SessionID;
import quickfix.SessionSettings;
import quickfix.SocketInitiator;


public class Main {


        private static final CountDownLatch shutdownLatch = new CountDownLatch(1);

        private static Main banzai;
        private boolean initiatorStarted = false;
        private Initiator initiator = null;

        public Main(String[] args) throws Exception {
                InputStream inputStream = null;
                if (args.length == 0) {
                        inputStream = Main.class.getResourceAsStream("banzai.cfg");
                } else if (args.length == 1) {
                        inputStream = new FileInputStream(args[0]);
                }
                if (inputStream == null) {
                        System.out.println("usage: " + Main.class.getName() + " [configFile].");
                        return;
                }
                SessionSettings settings = new SessionSettings(inputStream);
                inputStream.close();

                boolean logHeartbeats = Boolean.valueOf(System.getProperty("logHeartbeats", "true"));

                MainApplication application = new MainApplication();
                MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);
                LogFactory logFactory = new ScreenLogFactory(true, true, true, logHeartbeats);
                MessageFactory messageFactory = new DefaultMessageFactory();

                initiator = new SocketInitiator(application, messageStoreFactory, settings, logFactory,
                                messageFactory);
        }

        public synchronized void logon() {
                System.out.println("MAIN LOGON");

                try {
                        System.out.println("MAIN LOGON INITIATOR NOT STARTED");

                        initiator.start();
                        initiatorStarted = true;
                } catch (Exception e) {
                        System.out.println("exception");
                }

        }

        public static Main get() {
                return banzai;
        }

        public static void main(String[] args) throws Exception {

                banzai = new Main(args);
                banzai.logon();

                shutdownLatch.await();
        }

}


MainApplication.java

import java.util.HashMap;
import java.util.HashSet;

import javax.swing.SwingUtilities;

import quickfix.Application;
import quickfix.DefaultMessageFactory;
import quickfix.DoNotSend;
import quickfix.FieldNotFound;
import quickfix.IncorrectDataFormat;
import quickfix.IncorrectTagValue;
import quickfix.RejectLogon;
import quickfix.SessionID;
import quickfix.UnsupportedMessageType;
import quickfix.field.BusinessRejectReason;
import quickfix.field.DeliverToCompID;
import quickfix.field.ExecID;
import quickfix.field.MsgType;
import quickfix.field.SessionRejectReason;

public class MainApplication implements Application {


        public MainApplication() {
        }

        public void onCreate(SessionID sessionID) {
                System.out.println("onCreate");
        }

        public void onLogon(SessionID sessionID) {
                System.out.println("onlogon");

        }

        public void onLogout(SessionID sessionID) {
                System.out.println("onlogout");
        }

        public void toAdmin(quickfix.Message msg, SessionID sessionID) {
                String msgType;
                System.out.println("toadmin");

                try {
                        msgType = msg.getHeader().getString(MsgType.FIELD);

                        if(MsgType.LOGON.compareTo(msgType) == 0)
                        {
                                System.out.println("setlogon");
                                msg.setString(quickfix.field.Username.FIELD, username);
                                msg.setString(quickfix.field.Password.FIELD, password);
                        }
                } catch (Exception e) {
                        System.out.println("EXCEPTION");
                        e.printStackTrace();
                }

        }

        public void toApp(quickfix.Message message, SessionID sessionID) throws DoNotSend {
                System.out.println("toapp");
               

        }

        public void fromAdmin(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
        IncorrectDataFormat, IncorrectTagValue, RejectLogon {
                System.out.println("fromAdmin");

        }

        public void fromApp(quickfix.Message message, SessionID sessionID) throws FieldNotFound,
        IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType {
                System.out.println("fromApp");

        }

}

logs on screen

MAIN LOGON
MAIN LOGON INITIATOR NOT STARTED
Aug 04, 2015 9:53:18 AM quickfix.SessionSchedule <init>
INFO: [FIX.4.4:4396/1->ICE] daily, 00:00:00-UTC - 00:00:00-UTC
<20150804-07:53:18, FIX.4.4:4396/1->ICE, event> (Session FIX.4.4:4396/1->ICE schedule is daily, 00:00:00-UTC - 00:00:00-UTC)
<20150804-07:53:18, FIX.4.4:4396/1->ICE, event> (Created session: FIX.4.4:4396/1->ICE)
onCreate
Aug 04, 2015 9:53:18 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketTcpNoDelay=true
Aug 04, 2015 9:53:18 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketSynchronousWrites=false
Aug 04, 2015 9:53:18 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketSynchronousWriteTimeout=30000
Aug 04, 2015 9:53:18 AM quickfix.mina.initiator.IoSessionInitiator <init>
INFO: [FIX.4.4:4396/1->ICE] [/63.247.113.201:443]
Aug 04, 2015 9:53:18 AM quickfix.mina.SessionConnector startSessionTimer
INFO: SessionTimer started
Aug 04, 2015 9:53:18 AM quickfix.mina.SingleThreadedEventHandlingStrategy$1 run
INFO: Started QFJ Message Processor
Aug 04, 2015 9:53:19 AM quickfix.mina.initiator.InitiatorIoHandler sessionCreated
INFO: MINA session created for FIX.4.4:4396/1->ICE: local=/193.228.221.18:33289, class org.apache.mina.transport.socket.nio.NioSocketSession, remote=/63.247.113.201:443
toadmin
setlogon
<20150804-07:53:19, FIX.4.4:4396/1->ICE, outgoing> (8=FIX.4.49=10435=A34=149=439650=152=20150804-07:53:19.78756=ICE98=0108=30141=Y553=*****554=*****10=124)
<20150804-07:53:19, FIX.4.4:4396/1->ICE, event> (Initiated logon request)
<20150804-07:53:20, FIX.4.4:4396/1->ICE, incoming> (8=FIX.4.49=7335=A49=ICE34=152=20150804-07:53:20.58456=439657=198=0108=30141=Y10=181)
<20150804-07:53:20, FIX.4.4:4396/1->ICE, event> (Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1)
fromAdmin
<20150804-07:53:20, FIX.4.4:4396/1->ICE, event> (Received logon)
onlogon
toadmin
<20150804-07:53:50, FIX.4.4:4396/1->ICE, outgoing> (8=FIX.4.49=5535=034=249=439650=152=20150804-07:53:50.76556=ICE10=092)
toadmin
<20150804-07:54:05, FIX.4.4:4396/1->ICE, outgoing> (8=FIX.4.49=6435=134=349=439650=152=20150804-07:54:05.77356=ICE112=TEST10=112)
<20150804-07:54:05, FIX.4.4:4396/1->ICE, event> (Sent test request TEST)
<20150804-07:54:09, FIX.4.4:4396/1->ICE, error> (Disconnecting: Socket exception (/63.247.113.201:443): java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen)
onlogout
12
Loading...