|
From: DAVID H. V. <dav...@bb...> - 2019-07-26 11:53:08
|
Hi, Chris. >From what I've been able to see so far, I lean towards #2, but I have the feeling that there's a more fundamental thing to consider here, which is the fact that when connecting through a proxy, the IoSession object actually exists, so I think the main if statement would probably need to be changed and be made "proxy-aware" and not just rely on the existence of the object. Not sure if IoSession will expose all the information we need but I'll check. Otherwise, we would defeat the purpose of the pull request you mentioned. On the other hand, creating strategies would need to bear this in mind anyways... Does this make sense? Another interesting thing I found (potentially related to this), is that if you're connecting through a proxy, the Session.getRemoteAddress() method gives you the proxy address instead of the final endpoint (which is what I would expect). Thanks and regards. David. El vie., 26 jul. 2019 a las 12:58, Christoph John (<chr...@ma...>) escribió: > Hi David, > > this was changed and discussed here: > https://github.com/quickfix-j/quickfixj/pull/152 > There it is also said that "I don't think this connection establishment > logic can satisfy everyone. It would be better to extract interface and > have different implementations - round-robin for LB, etc. But it is a > separate feature, not a quick change." > > So as I see it we have two possibilities now: > 1. Implement different strategies > 2. Make the reset of the nextSocketAddressIndex conditional depending on > whether a proxy is used or not > > What do you think? Do you have another idea? > > Cheers, > Chris. > > > > On 26.07.19 12:47, DAVID HERNANDO VIEITES wrote: > > Hi, Chris. > > Thanks for your reply. > > My first idea would be to remove the line that resets > nextSocketAddressIndex within pollConnectFuture, but I'm not sure about the > reason why it's there in the first place. Is there a reason behind it? I > could compare with older versions and the line wasn't there but I couldn't > track it down to a specific reason. > > Thanks again. > > David. > > El vie., 26 jul. 2019 a las 12:41, Christoph John (< > chr...@ma...>) escribió: > >> Hi David, >> >> thanks for your problem description. I never used QFJ in a proxy scenario >> but what you describe makes sense to me. >> Please open a JIRA ticket for this or even better create a pull request >> with a proposed fix. :) https://github.com/quickfix-j/quickfixj/pulls >> >> Many thanks in advance and best regards, >> Chris. >> >> On 26.07.19 09:10, DAVID HERNANDO VIEITES via Quickfixj-users wrote: >> >> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ >> QuickFIX/J Support: http://www.quickfixj.org/support/ >> >> >> Hi, everyone. >> >> We started using QFJ 2.1.1 recently and I think we found an issue with >> the use of failover hosts through a proxy. >> >> We have a cfg file with this set up (just leaving the relevant pieces): >> >> ProxyType=http >> ProxyVersion=1.0 >> ProxyHost=xyz >> ProxyPort=8080 >> ProxyUser=usr >> ProxyPassword=pwd >> >> [SESSION] >> SocketConnectHost=a.b.c.d >> SocketConnectPort=5013 >> # Alternative connection host >> SocketConnectHost1=d.c.b.a >> SocketConnectPort1=5013 >> >> >> If the connection to the first host in the list could not be established, >> the library is supposed to move to the next one and try it on the next >> reconnection attempt. However, that doesn't seem to be the case when a >> proxy is defined, because what I see is that the address being used is >> always the first one. >> >> I think the issue may be within the IoSessionInitiator class. In >> particular in the pollConnectFuture() method. When connecting through a >> proxy, the if statement is always not null (assuming you're successfully >> connected to the proxy), so the nextSocketAddressIndex gets constantly >> reset even if you couldn't reach the endpoint. >> >> private void pollConnectFuture() { >> try { >> this.connectFuture.awaitUninterruptibly(2000L); if (this.connectFuture.getSession() != null) { >> this.ioSession = this.connectFuture.getSession(); this.connectionFailureCount = 0; this.nextSocketAddressIndex = 0; this.lastConnectTime = System.currentTimeMillis(); this.connectFuture = null; } else { >> this.fixSession.getLog().onEvent("Pending connection not established after " + (System.currentTimeMillis() - this.lastReconnectAttemptTime) + " ms."); } >> } catch (Throwable var2) { >> this.handleConnectException(var2); } >> >> } >> >> I was going to open a Jira ticket, but wanted to comment over here first. >> >> Many thanks! >> >> >> >> "Este mensaje está dirigido de manera exclusiva a su destinatario y puede >> contener información privada y confidencial. No lo reenvíe, copie o >> distribuya a terceros que no deban conocer su contenido. En caso de haberlo >> recibido por error, rogamos lo notifique al remitente y proceda a su >> borrado, así como al de cualquier documento que pudiera adjuntarse. >> >> Por favor tenga en cuenta que los correos enviados vía Internet no >> permiten garantizar la confidencialidad de los mensajes ni su transmisión >> de forma íntegra. >> >> Las opiniones expresadas en el presente correo pertenecen únicamente al >> remitente y no representan necesariamente la opinión del Grupo BBVA." >> >> "This message is intended exclusively for the adressee and may contain >> privileged and confidential information. Please, do not disseminate, copy >> or distribute it to third parties who should not receive it. In case you >> have received it by mistake, please inform the sender and delete the >> message and attachments from your system. >> >> Please keep in mind that e-mails sent by Internet do not allow to >> guarantee neither the confidentiality or the integrity of the messages >> sent." >> >> >> _______________________________________________ >> 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 >> >> > > -- > [image: BBVA | Creando Oportunidades] > *David Hernando Vieites* > *Global Markets - eCommerce & FX IT* > Tel: +34 670 47 53 62 - 225362 > dav...@bb... > C/ Azul, 4 Planta 2, 28050 Madrid > > > "Este mensaje está dirigido de manera exclusiva a su destinatario y puede > contener información privada y confidencial. No lo reenvíe, copie o > distribuya a terceros que no deban conocer su contenido. En caso de haberlo > recibido por error, rogamos lo notifique al remitente y proceda a su > borrado, así como al de cualquier documento que pudiera adjuntarse. > > Por favor tenga en cuenta que los correos enviados vía Internet no > permiten garantizar la confidencialidad de los mensajes ni su transmisión > de forma íntegra. > > Las opiniones expresadas en el presente correo pertenecen únicamente al > remitente y no representan necesariamente la opinión del Grupo BBVA." > > "This message is intended exclusively for the adressee and may contain > privileged and confidential information. Please, do not disseminate, copy > or distribute it to third parties who should not receive it. In case you > have received it by mistake, please inform the sender and delete the > message and attachments from your system. > > Please keep in mind that e-mails sent by Internet do not allow to > guarantee neither the confidentiality or the integrity of the messages > sent." > > > -- > 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 > > -- [image: BBVA | Creando Oportunidades] *David Hernando Vieites* *Global Markets - eCommerce & FX IT* Tel: +34 670 47 53 62 - 225362 dav...@bb... C/ Azul, 4 Planta 2, 28050 Madrid -- "Este mensaje está dirigido de manera exclusiva a su destinatario y puede contener información privada y confidencial. No lo reenvíe, copie o distribuya a terceros que no deban conocer su contenido. En caso de haberlo recibido por error, rogamos lo notifique al remitente y proceda a su borrado, así como al de cualquier documento que pudiera adjuntarse. Por favor tenga en cuenta que los correos enviados vía Internet no permiten garantizar la confidencialidad de los mensajes ni su transmisión de forma íntegra. Las opiniones expresadas en el presente correo pertenecen únicamente al remitente y no representan necesariamente la opinión del Grupo BBVA." "This message is intended exclusively for the adressee and may contain privileged and confidential information. Please, do not disseminate, copy or distribute it to third parties who should not receive it. In case you have received it by mistake, please inform the sender and delete the message and attachments from your system. Please keep in mind that e-mails sent by Internet do not allow to guarantee neither the confidentiality or the integrity of the messages sent." |