Reputation: 327
Iam using quickfixj-1.5.3.
When I am trying to connect, I am getting below error.
<20150211-04:16:04, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:16:19, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:16:34, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:16:49, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:17:04, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:17:19, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:17:34, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:17:49, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:18:04, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds)) <20150211-04:18:19, FIX.4.4:ABCD.ZYXW.IJK->ABCD, error> (java.net.ConnectException: java.net.ConnectException: Connection refused (Next retry in 15000 milliseconds))
I need to access this error event.
I have checked in fromApp()
and other related functions, but the error event is not invoked in any of those functions.
Is it possible to access this error event from inside the initiator java file ?
My requirement is to connect to a backup server port, whenever this kind of error is coming...
Upvotes: 0
Views: 861
Reputation: 5766
There is a perfectly feasible way documented in the QuickFIX/J configuration page. Did you use those settings ? Or is your query inspite of using the configurations ? And as a rule of thumb, try fixing the error you get rather than trying the other way around. If it is only for a port, this might work. But if you aren't allowed access to any of the ports, this ain't gonna happen.
SocketConnectHost - Alternate socket hosts for connecting to a session for failover, where n is a positive integer. (i.e.) SocketConnectHost1, SocketConnectHost2... must be consecutive and have a matching SocketConnectPort[n] valid IP address in the format of x.x.x.x or a domain name
Upvotes: 2
Reputation: 18484
The connection was refused.
You can do everything right, but if the other side refuses it, it's not going to happen.
So... you need to find out why the other side is refusing it. Can you telnet to the destination host/port?
Upvotes: 1